diff --git a/interface/src/raypick/ParabolaPointer.cpp b/interface/src/raypick/ParabolaPointer.cpp index f59cd7a0f1..4f65480191 100644 --- a/interface/src/raypick/ParabolaPointer.cpp +++ b/interface/src/raypick/ParabolaPointer.cpp @@ -230,7 +230,6 @@ void ParabolaPointer::RenderState::update(const glm::vec3& origin, const glm::ve item.updateBounds(); }); scene->enqueueTransaction(transaction); - qDebug() << "ParabolaPointer::RenderState::update"; } } @@ -284,7 +283,6 @@ std::shared_ptr ParabolaPointer::buildRenderState(const QVa if (pathMap["drawInFront"].isValid()) { drawInFront = pathMap["drawInFront"].toBool(); } - qDebug() << "ParabolaPointer::buildRenderState"; } QUuid endID; @@ -470,7 +468,6 @@ void ParabolaPointer::RenderState::ParabolaRenderItem::render(RenderArgs* args) // We draw 2 * n + 2 vertices for a triangle strip batch.draw(gpu::TRIANGLE_STRIP, 2 * _parabolaData.numSections + 2, 0); - qDebug() << "ParabolaPointer::RenderState::ParabolaRenderItem::render"; } namespace render { diff --git a/libraries/script-engine/src/ScriptEngine.h b/libraries/script-engine/src/ScriptEngine.h index fc1bfc094f..dfff5b93c4 100644 --- a/libraries/script-engine/src/ScriptEngine.h +++ b/libraries/script-engine/src/ScriptEngine.h @@ -27,7 +27,7 @@ #include "ScriptException.h" // These are used for debugging memory leaks caused by persistent handles -#define OVERTE_V8_MEMORY_DEBUG +//#define OVERTE_V8_MEMORY_DEBUG class QByteArray; class QLatin1String; diff --git a/libraries/script-engine/src/XMLHttpRequestClass.cpp b/libraries/script-engine/src/XMLHttpRequestClass.cpp index caca759096..f6b38c11ed 100644 --- a/libraries/script-engine/src/XMLHttpRequestClass.cpp +++ b/libraries/script-engine/src/XMLHttpRequestClass.cpp @@ -234,6 +234,8 @@ void XMLHttpRequestClass::requestFinished() { } } + qDebug() << "XMLHttpRequestClass::requestFinished : ec: " << _errorCode << " rt: " << _responseType << " URL: " << _url + << " method: " << _method << "data" << QString(_rawResponseData.data()); setReadyState(DONE); emit requestComplete(); diff --git a/libraries/script-engine/src/v8/ScriptValueV8Wrapper.h b/libraries/script-engine/src/v8/ScriptValueV8Wrapper.h index 3c4f7ff427..aff0685e58 100644 --- a/libraries/script-engine/src/v8/ScriptValueV8Wrapper.h +++ b/libraries/script-engine/src/v8/ScriptValueV8Wrapper.h @@ -32,9 +32,17 @@ public: // construction ScriptValueV8Wrapper() = delete; //ScriptValueV8Wrapper(ScriptValueV8Wrapper &) = delete; inline ScriptValueV8Wrapper(ScriptEngineV8* engine, const V8ScriptValue& value) : - _engine(engine), _value(value) { engine->incrementScriptValueProxyCounter(); } + _engine(engine), _value(value) { +#ifdef OVERTE_V8_MEMORY_DEBUG + engine->incrementScriptValueProxyCounter(); +#endif + } inline ScriptValueV8Wrapper(ScriptEngineV8* engine, V8ScriptValue&& value) : - _engine(engine), _value(std::move(value)) { engine->incrementScriptValueProxyCounter(); } + _engine(engine), _value(std::move(value)) { +#ifdef OVERTE_V8_MEMORY_DEBUG + engine->incrementScriptValueProxyCounter(); +#endif + } static ScriptValueV8Wrapper* unwrap(const ScriptValue& val); inline const V8ScriptValue& toV8Value() const { return _value; } static V8ScriptValue fullUnwrap(ScriptEngineV8* engine, const ScriptValue& value); @@ -95,7 +103,11 @@ public: // ScriptValue implementation virtual QObject* toQObject() const override; protected: - virtual ~ScriptValueV8Wrapper() { _engine->decrementScriptValueProxyCounter(); }; + virtual ~ScriptValueV8Wrapper() { +#ifdef OVERTE_V8_MEMORY_DEBUG + _engine->decrementScriptValueProxyCounter(); +#endif + }; private: // helper functions V8ScriptValue fullUnwrap(const ScriptValue& value) const; diff --git a/scripts/system/controllers/controllerModules/teleport.js b/scripts/system/controllers/controllerModules/teleport.js index f000120356..63106b6241 100644 --- a/scripts/system/controllers/controllerModules/teleport.js +++ b/scripts/system/controllers/controllerModules/teleport.js @@ -521,17 +521,20 @@ Script.include("/~/system/libraries/controllers.js"); } else { // Set play area position and rotation in local coordinates with parenting. var targetRotation = Entities.getEntityProperties(_this.targetOverlayID, ["rotation"]).rotation; - var sensorToTargetRotation = Quat.multiply(Quat.inverse(targetRotation), sensorToWorldRotation); - var relativePlayAreaCenterOffset = - Vec3.sum(_this.playAreaCenterOffset, { x: 0, y: -TARGET_MODEL_DIMENSIONS.y / 2, z: 0 }); - Overlays.editOverlay(_this.playAreaOverlay, { - parentID: _this.targetOverlayID, - localPosition: Vec3.multiplyQbyV(Quat.inverse(targetRotation), - Vec3.multiplyQbyV(sensorToWorldRotation, - Vec3.multiply(MyAvatar.sensorToWorldScale, - Vec3.subtract(relativePlayAreaCenterOffset, avatarSensorPosition)))), - localRotation: sensorToTargetRotation - }); + // TODO: Why is targetRotation undefined sometimes? + if (targetRotation) { + var sensorToTargetRotation = Quat.multiply(Quat.inverse(targetRotation), sensorToWorldRotation); + var relativePlayAreaCenterOffset = + Vec3.sum(_this.playAreaCenterOffset, {x: 0, y: -TARGET_MODEL_DIMENSIONS.y / 2, z: 0}); + Overlays.editOverlay(_this.playAreaOverlay, { + parentID: _this.targetOverlayID, + localPosition: Vec3.multiplyQbyV(Quat.inverse(targetRotation), + Vec3.multiplyQbyV(sensorToWorldRotation, + Vec3.multiply(MyAvatar.sensorToWorldScale, + Vec3.subtract(relativePlayAreaCenterOffset, avatarSensorPosition)))), + localRotation: sensorToTargetRotation + }); + } } }; diff --git a/scripts/system/create/editModes/editVoxels.js b/scripts/system/create/editModes/editVoxels.js index 53fae0ae7f..13138e55e1 100644 --- a/scripts/system/create/editModes/editVoxels.js +++ b/scripts/system/create/editModes/editVoxels.js @@ -654,10 +654,10 @@ EditVoxels = function() { } function cleanup() { - Controller.mousePressEvent.disconnect(self.mousePressEvent); - Controller.mouseReleaseEvent.disconnect(self.mouseReleaseEvent); - Controller.keyPressEvent.disconnect(self.keyPressEvent); - Controller.keyReleaseEvent.disconnect(self.keyReleaseEvent); + Controller.mousePressEvent.disconnect(mousePressEvent); + Controller.mouseReleaseEvent.disconnect(mouseReleaseEvent); + Controller.keyPressEvent.disconnect(keyPressEvent); + Controller.keyReleaseEvent.disconnect(keyReleaseEvent); } Controller.mousePressEvent.connect(mousePressEvent); diff --git a/scripts/system/create/entitySelectionTool/entitySelectionTool.js b/scripts/system/create/entitySelectionTool/entitySelectionTool.js index 8a62436a95..38a0d684cc 100644 --- a/scripts/system/create/entitySelectionTool/entitySelectionTool.js +++ b/scripts/system/create/entitySelectionTool/entitySelectionTool.js @@ -2638,7 +2638,12 @@ SelectionDisplay = (function() { that.showDebugPickPlaneHit(newPick); } - var vector = Vec3.subtract(newPick, initialPick); + var vector = null; + if (initialPick) { + vector = Vec3.subtract(newPick, initialPick); + } else { + vector = newPick; + } // If the mouse is too close to the horizon of the pick plane, stop moving var MIN_ELEVATION = 0.02; // largest dimension of object divided by distance to it