From 29f083547527adbdc74c86b71c62af1caefd861c Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Wed, 20 Dec 2017 16:06:19 -0800 Subject: [PATCH 01/10] making entity joints work again --- .../src/RenderableModelEntityItem.cpp | 4 ++- script-archive/dressing_room/doppelganger.js | 34 +++++++++---------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp index e578e4858d..ce43aa4eb5 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp @@ -1259,7 +1259,9 @@ void ModelEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce _currentTextures = newTextures; } } - + if(entity->_needsJointSimulation) { + entity->copyAnimationJointDataToModel(); + } entity->updateModelBounds(); if (model->isVisible() != _visible) { diff --git a/script-archive/dressing_room/doppelganger.js b/script-archive/dressing_room/doppelganger.js index 10f6468e9f..8ff62ff665 100644 --- a/script-archive/dressing_room/doppelganger.js +++ b/script-archive/dressing_room/doppelganger.js @@ -15,7 +15,7 @@ var TEST_MODEL_URL = 'https://s3.amazonaws.com/hifi-public/ozan/avatars/albert/a var MIRROR_JOINT_DATA = true; var MIRRORED_ENTITY_SCRIPT_URL = Script.resolvePath('mirroredEntity.js'); -var FREEZE_TOGGLER_SCRIPT_URL = Script.resolvePath('freezeToggler.js?' + Math.random(0, 1000)) +var FREEZE_TOGGLER_SCRIPT_URL = Script.resolvePath('freezeToggler.js?' + Math.random(0, 1000)); var THROTTLE = false; var THROTTLE_RATE = 100; var doppelgangers = []; @@ -24,8 +24,7 @@ function Doppelganger(avatar) { this.initialProperties = { name: 'Hifi-Doppelganger', type: 'Model', - modelURL: TEST_MODEL_URL, - // dimensions: getAvatarDimensions(avatar), + modelURL: MyAvatar.skeletonModelURL, position: putDoppelgangerAcrossFromAvatar(this, avatar), rotation: rotateDoppelgangerTowardAvatar(this, avatar), collisionsWillMove: false, @@ -33,7 +32,7 @@ function Doppelganger(avatar) { script: FREEZE_TOGGLER_SCRIPT_URL, userData: JSON.stringify({ grabbableKey: { - grabbable: false, + grabbable: true, wantsTrigger: true } }) @@ -48,7 +47,7 @@ function getJointData(avatar) { var jointNames = MyAvatar.jointNames; jointNames.forEach(function(joint, index) { var translation = MyAvatar.getJointTranslation(index); - var rotation = MyAvatar.getJointRotation(index) + var rotation = MyAvatar.getJointRotation(index); allJointData.push({ joint: joint, index: index, @@ -65,9 +64,10 @@ function setJointData(doppelganger, relativeXforms) { var i, l = relativeXforms.length; for (i = 0; i < l; i++) { jointRotations.push(relativeXforms[i].rot); + //Entities.setAbsoluteJointRotationInObjectFrame(doppelganger.id, i, relativeXforms[i].rot); } - Entities.setAbsoluteJointRotationsInObjectFrame(doppelganger.id, jointRotations); + Entities.setLocalJointRotations(doppelganger.id, jointRotations); return true; } @@ -127,7 +127,7 @@ var JOINT_MIRROR_NAME_MAP = { LeftHandPinky2: "RightHandPinky2", LeftHandPinky3: "RightHandPinky3", LeftHandPinky4: "RightHandPinky4", - LeftHandPinky: "RightHandPinky", + LeftHandPinky: "RightHandPinky" }; // maps joint names to parent joint names. @@ -192,7 +192,7 @@ var JOINT_PARENT_NAME_MAP = { LeftHandPinky1: "LeftHand", LeftHandPinky2: "LeftHandPinky1", LeftHandPinky3: "LeftHandPinky2", - LeftHandPinky: "LeftHandPinky3", + LeftHandPinky: "LeftHandPinky3" }; // maps joint indices to parent joint indices. @@ -395,7 +395,7 @@ function connectDoppelgangerUpdates() { } function disconnectDoppelgangerUpdates() { - print('SHOULD DISCONNECT') + print('SHOULD DISCONNECT'); if (isConnected === true) { Script.update.disconnect(updateDoppelganger); } @@ -465,13 +465,13 @@ function handleFreezeMessages(channel, message, sender) { } catch (e) { print('error parsing wearable message'); } - print('MESSAGE ACTION::' + parsedMessage.action) + print('MESSAGE ACTION::' + parsedMessage.action); if (parsedMessage.action === 'freeze') { - print('ACTUAL FREEZE') + print('ACTUAL FREEZE'); disconnectDoppelgangerUpdates(); } if (parsedMessage.action === 'unfreeze') { - print('ACTUAL UNFREEZE') + print('ACTUAL UNFREEZE'); connectDoppelgangerUpdates(); } @@ -496,7 +496,7 @@ function handleWearableMessages(channel, message, sender) { } catch (e) { print('error parsing wearable message'); } - print('parsed message!!!') + print('parsed message!!!'); if (channel === 'Hifi-Doppelganger-Wearable') { mirrorEntitiesForDoppelganger(doppelgangers[0], parsedMessage); @@ -511,13 +511,13 @@ function mirrorEntitiesForDoppelganger(doppelganger, parsedMessage) { var doppelgangerProps = Entities.getEntityProperties(doppelganger.id); var action = parsedMessage.action; - print('IN MIRROR ENTITIES CALL' + action) + print('IN MIRROR ENTITIES CALL' + action); var baseEntity = parsedMessage.baseEntity; var wearableProps = Entities.getEntityProperties(baseEntity); - print('WEARABLE PROPS::') + print('WEARABLE PROPS::'); delete wearableProps.id; delete wearableProps.created; delete wearableProps.age; @@ -613,7 +613,7 @@ function getBaseEntityForMirrorEntity(mirrorEntity) { makeDoppelgangerForMyAvatar(); subscribeToWearableMessages(); -subscribeToWearableMessagesForAvatar(); +//subscribeToWearableMessagesForAvatar(); subscribeToFreezeMessages(); function cleanup() { @@ -626,4 +626,4 @@ function cleanup() { Entities.deleteEntity(doppelganger.id); }); } -Script.scriptEnding.connect(cleanup); \ No newline at end of file +Script.scriptEnding.connect(cleanup); From 77874de9093bebd98377dd4d8e8400ce32adce1f Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Thu, 21 Dec 2017 15:05:23 -0800 Subject: [PATCH 02/10] fix spacing --- interface/resources/qml/js/Utils.jsc | Bin 6596 -> 6548 bytes .../src/RenderableModelEntityItem.cpp | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/js/Utils.jsc b/interface/resources/qml/js/Utils.jsc index ab20e996b9469915ac6a89901da175143e6b5024..96c5b26fda10a505b491ad2d08588089fdfa8922 100644 GIT binary patch delta 581 zcmZ9JO=uHQ5Xb+s*~m5+UsBqp_2OZ35G~|MD|kpTN+=slRs3o$N>=|N=0 zAPu=Rj9`vEh^H2mEhyfUf;|XUP*9NCn-)BT2!bCNdC7{_cl`b4&HR~J8M-qxc;(vg zg$cW4hXGKRA8%ITi{}VP`hohbqPc!==JlT3kIKuX+o{@MnU2>Uj%zSDKxb%!Z5j_G zf@r_xZTyTz3EZVU3ct{S_d4)d2Y%|nu=`58OfFUK-`zxovLb9HIYqKlF|BDwQsC?!b5q5 z=C`0}h32-PS%sW`k>dbJRm#!XR;%R+ZUp<&oxaYzr}KYxJA+gAMD~BN;E7B}9D06O z@~It9`xkXJC>gC=k2{M4a+WAG_<^t}&EJINyP}uw^O88CJ@N5(5!?T#v~f_Ct~N#J zT~lP%bC$TVmfrVCwOeS4(3j2CU+wg2*iN1@O!s4Gnn-e{+m3jF)l~ICElJh6Yu#DW u0N&d(r^z563z+=2=Kx7J+`CDNOc^HciU^W!Eb^87QXQOcZtvs7K>0Vt9l7@a delta 637 zcmbPYe8gC%u*@VmC9xz?kb!}Lfs>VC&A*2iV;C72bXXY}mb_f{tI)LMb*EnX9J{G= zWhd&iFd9tU7|!&7eKHqg7~_G-iHzY~3cMh#3=G`tlMgYvF&a$fWZEvcg@u9P2nz$l z6&41DCoBvMGMg_lWiv8bOtxi_WOruBXGmd4om|Nh%*?>RF!?k~?dAYhTV_U!&3zpA z85u1$=W*FErx|#5GkJ77BzShZsLb%~7W3^6f(m7TgeIT}6@Y{~P=qQ#LJi154Gjzo z44$1WDi#0#|A$IU7T}ZcftcGc0VHq)#(>(a=Zul6!06AyDCw_rXFZq!SU|;|l@WHnm>~<-TO!FIsU6ZGCNN?UCPymWD zMWIA-XgGk}2r>s0_8`A*o+*^TI7y_L$%1!sK9}<36(Sal7MmZ6ykrE4^m8arelNz) YXtDXf*f&O23s6FtypTt1vVdd@0Nd!%PXGV_ diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp index cfce275008..0b8c1a5bc5 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp @@ -1255,7 +1255,7 @@ void ModelEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce _currentTextures = newTextures; } } - if(entity->_needsJointSimulation) { + if (entity->_needsJointSimulation) { entity->copyAnimationJointDataToModel(); } entity->updateModelBounds(); From afc71a5ac5090487961273f678a02b7363555cf8 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Thu, 25 Jan 2018 12:17:34 -0800 Subject: [PATCH 03/10] Fix Purchases sorting (again); Fix (i) icon loading --- .../hifi/commerce/common/SortableListModel.qml | 16 +++++++++------- .../qml/hifi/commerce/purchases/Purchases.qml | 8 ++++++-- .../src/ui/overlays/ContextOverlayInterface.cpp | 2 +- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/interface/resources/qml/hifi/commerce/common/SortableListModel.qml b/interface/resources/qml/hifi/commerce/common/SortableListModel.qml index 0951d25950..cfdd4abe04 100644 --- a/interface/resources/qml/hifi/commerce/common/SortableListModel.qml +++ b/interface/resources/qml/hifi/commerce/common/SortableListModel.qml @@ -22,7 +22,7 @@ ListModel { function swap(a, b) { if (a < b) { move(a, b, 1); - move (b - 1, a, 1); + move(b - 1, a, 1); } else if (a > b) { move(b, a, 1); move(a - 1, b, 1); @@ -34,16 +34,17 @@ ListModel { var piv = get(pivot)[sortColumnName]; swap(pivot, end - 1); var store = begin; + var i; - for (var i = begin; i < end - 1; ++i) { + for (i = begin; i < end - 1; ++i) { var currentElement = get(i)[sortColumnName]; if (isSortingDescending) { - if (currentElement < piv) { + if (currentElement > piv) { swap(store, i); ++store; } } else { - if (currentElement > piv) { + if (currentElement < piv) { swap(store, i); ++store; } @@ -56,16 +57,17 @@ ListModel { var piv = get(pivot)[sortColumnName].toLowerCase(); swap(pivot, end - 1); var store = begin; + var i; - for (var i = begin; i < end - 1; ++i) { + for (i = begin; i < end - 1; ++i) { var currentElement = get(i)[sortColumnName].toLowerCase(); if (isSortingDescending) { - if (currentElement < piv) { + if (currentElement > piv) { swap(store, i); ++store; } } else { - if (currentElement > piv) { + if (currentElement < piv) { swap(store, i); ++store; } diff --git a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml index a9961dc17e..2743677683 100644 --- a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml +++ b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml @@ -317,6 +317,7 @@ Rectangle { HifiControlsUit.TextField { id: filterBar; + property string previousText: ""; colorScheme: hifi.colorSchemes.faintGray; hasClearButton: true; hasRoundedBorder: true; @@ -329,6 +330,8 @@ Rectangle { onTextChanged: { buildFilteredPurchasesModel(); + purchasesContentsList.positionViewAtIndex(0, ListView.Beginning) + filterBar.previousText = filterBar.text; } onAccepted: { @@ -647,7 +650,8 @@ Rectangle { function sortByDate() { filteredPurchasesModel.sortColumnName = "purchase_date"; - filteredPurchasesModel.isSortingDescending = false; + filteredPurchasesModel.isSortingDescending = true; + filteredPurchasesModel.valuesAreNumerical = true; filteredPurchasesModel.quickSort(); } @@ -677,7 +681,7 @@ Rectangle { } } - if (sameItemCount !== tempPurchasesModel.count || filterBar.text !== "") { + if (sameItemCount !== tempPurchasesModel.count || filterBar.text !== filterBar.previousText) { filteredPurchasesModel.clear(); for (var i = 0; i < tempPurchasesModel.count; i++) { filteredPurchasesModel.append(tempPurchasesModel.get(i)); diff --git a/interface/src/ui/overlays/ContextOverlayInterface.cpp b/interface/src/ui/overlays/ContextOverlayInterface.cpp index d690880f99..58a77883d8 100644 --- a/interface/src/ui/overlays/ContextOverlayInterface.cpp +++ b/interface/src/ui/overlays/ContextOverlayInterface.cpp @@ -168,8 +168,8 @@ bool ContextOverlayInterface::createOrDestroyContextOverlay(const EntityItemID& _contextOverlay->setColorPulse(CONTEXT_OVERLAY_UNHOVERED_COLORPULSE); _contextOverlay->setIgnoreRayIntersection(false); _contextOverlay->setDrawInFront(true); - _contextOverlay->setURL(PathUtils::resourcesPath() + "images/inspect-icon.png"); _contextOverlay->setIsFacingAvatar(true); + _contextOverlay->setURL(PathUtils::resourcesUrl() + "images/inspect-icon.png"); _contextOverlayID = qApp->getOverlays().addOverlay(_contextOverlay); } _contextOverlay->setWorldPosition(contextOverlayPosition); From bde5282541cbd039183758521baf080cee509dba Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Thu, 25 Jan 2018 12:43:49 -0800 Subject: [PATCH 04/10] Fix loading of the render config JSON --- libraries/render/src/render/Engine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/render/src/render/Engine.cpp b/libraries/render/src/render/Engine.cpp index 5f67d40d17..463b45451b 100644 --- a/libraries/render/src/render/Engine.cpp +++ b/libraries/render/src/render/Engine.cpp @@ -45,8 +45,8 @@ void Engine::load() { auto config = getConfiguration(); const QString configFile= "config/render.json"; - QUrl path(PathUtils::resourcesPath() + configFile); - QFile file(path.toString()); + QString path(PathUtils::resourcesPath() + configFile); + QFile file(path); if (!file.exists()) { qWarning() << "Engine configuration file" << path << "does not exist"; } else if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { From ac94327ec72edec08cdc5b188fd5d3028d574a3d Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Thu, 25 Jan 2018 12:44:55 -0800 Subject: [PATCH 05/10] Fix loading of the context overlay information icon --- interface/src/ui/overlays/ContextOverlayInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/ui/overlays/ContextOverlayInterface.cpp b/interface/src/ui/overlays/ContextOverlayInterface.cpp index d690880f99..d4138941ae 100644 --- a/interface/src/ui/overlays/ContextOverlayInterface.cpp +++ b/interface/src/ui/overlays/ContextOverlayInterface.cpp @@ -168,7 +168,7 @@ bool ContextOverlayInterface::createOrDestroyContextOverlay(const EntityItemID& _contextOverlay->setColorPulse(CONTEXT_OVERLAY_UNHOVERED_COLORPULSE); _contextOverlay->setIgnoreRayIntersection(false); _contextOverlay->setDrawInFront(true); - _contextOverlay->setURL(PathUtils::resourcesPath() + "images/inspect-icon.png"); + _contextOverlay->setURL(PathUtils::resourcesUrl() + "images/inspect-icon.png"); _contextOverlay->setIsFacingAvatar(true); _contextOverlayID = qApp->getOverlays().addOverlay(_contextOverlay); } From d4aef1ea8803c1e4213f96741b7efae060f746ab Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Thu, 25 Jan 2018 13:03:42 -0800 Subject: [PATCH 06/10] Fix URLs in QSS files to use QRC base path --- interface/resources/styles/global.qss | 10 +++++----- interface/resources/styles/import_dialog.qss | 6 +++--- interface/resources/styles/log_dialog.qss | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/interface/resources/styles/global.qss b/interface/resources/styles/global.qss index 2554f3b2c9..778e5759b3 100644 --- a/interface/resources/styles/global.qss +++ b/interface/resources/styles/global.qss @@ -41,14 +41,14 @@ QSpinBox, QDoubleSpinBox { QDoubleSpinBox::up-arrow, QSpinBox::up-arrow { - background-image: url(styles/up.svg); + background-image: url(:/styles/up.svg); background-repeat: no-repeat; background-position: center center; } QDoubleSpinBox::down-arrow, QSpinBox::down-arrow { - background-image: url(styles/down.svg); + background-image: url(:/styles/down.svg); background-repeat: no-repeat; background-position: center center; } @@ -88,7 +88,7 @@ QSlider { QSlider::groove:horizontal { border: none; - background-image: url(styles/slider-bg.svg); + background-image: url(:/styles/slider-bg.svg); background-repeat: no-repeat; background-position: center center; } @@ -96,7 +96,7 @@ QSlider::groove:horizontal { QSlider::handle:horizontal { width: 18px; height: 18px; - background-image: url(styles/slider-handle.svg); + background-image: url(:/styles/slider-handle.svg); background-repeat: no-repeat; background-position: center center; } @@ -107,7 +107,7 @@ QPushButton#closeButton { border-width: 1px; border-radius: 0; background-color: #fff; - background-image: url(styles/close.svg); + background-image: url(:/styles/close.svg); background-repeat: no-repeat; background-position: center center; } diff --git a/interface/resources/styles/import_dialog.qss b/interface/resources/styles/import_dialog.qss index 8fe04ae1b7..3c2dbdcce9 100644 --- a/interface/resources/styles/import_dialog.qss +++ b/interface/resources/styles/import_dialog.qss @@ -63,17 +63,17 @@ QPushButton#cancelButton { } #backButton { - background-image: url(icons/backButton.svg); + background-image: url(:/icons/backButton.svg); border-radius: 0px; } #forwardButton { - background-image: url(icons/forwardButton.svg); + background-image: url(:/icons/forwardButton.svg); border-radius: 0px; } #toParentButton { - background-image: url(icons/toParentButton.svg); + background-image: url(:/icons/toParentButton.svg); border-radius: 0px; } diff --git a/interface/resources/styles/log_dialog.qss b/interface/resources/styles/log_dialog.qss index 33473d2903..e0ec17549d 100644 --- a/interface/resources/styles/log_dialog.qss +++ b/interface/resources/styles/log_dialog.qss @@ -22,7 +22,7 @@ QLineEdit { } QPushButton#searchButton { - background: url(styles/search.svg); + background: url(:/styles/search.svg); background-repeat: none; background-position: left center; background-origin: content; @@ -55,7 +55,7 @@ QPushButton#searchPrevButton { QPushButton#revealLogButton { font-family: Helvetica, Arial, sans-serif; - background: url(styles/txt-file.svg); + background: url(:/styles/txt-file.svg); background-repeat: none; background-position: left center; background-origin: content; @@ -86,11 +86,11 @@ QCheckBox { } QCheckBox::indicator:unchecked { - image: url(styles/unchecked.svg); + image: url(:/styles/unchecked.svg); } QCheckBox::indicator:checked { - image: url(styles/checked.svg); + image: url(:/styles/checked.svg); } QComboBox { @@ -110,6 +110,6 @@ QComboBox::drop-down { } QComboBox::down-arrow { - image: url(styles/filter.png); + image: url(:/styles/filter.png); border-width: 0px; } \ No newline at end of file From 867bb99b51bde9f36eb9e69ebd5ec5bed7b707d6 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Thu, 25 Jan 2018 13:04:08 -0800 Subject: [PATCH 07/10] Fix help screen URL --- interface/src/Application.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index c2b22b3772..9379c85fdd 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2724,7 +2724,7 @@ void Application::showHelp() { queryString.addQueryItem("defaultTab", defaultTab); auto tabletScriptingInterface = DependencyManager::get(); TabletProxy* tablet = dynamic_cast(tabletScriptingInterface->getTablet(SYSTEM_TABLET)); - tablet->gotoWebScreen(PathUtils::resourcesPath() + INFO_HELP_PATH + "?" + queryString.toString()); + tablet->gotoWebScreen(PathUtils::resourcesUrl() + INFO_HELP_PATH + "?" + queryString.toString()); DependencyManager::get()->openTablet(); //InfoView::show(INFO_HELP_PATH, false, queryString.toString()); } From ab4e2d99f1939b2e5b6e7281ad69dfeea4e92850 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Thu, 25 Jan 2018 13:04:54 -0800 Subject: [PATCH 08/10] Don't try to set the current directory to a QRC path --- interface/src/ui/BaseLogDialog.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/interface/src/ui/BaseLogDialog.cpp b/interface/src/ui/BaseLogDialog.cpp index 6830de6e35..969f9895de 100644 --- a/interface/src/ui/BaseLogDialog.cpp +++ b/interface/src/ui/BaseLogDialog.cpp @@ -39,7 +39,6 @@ BaseLogDialog::BaseLogDialog(QWidget* parent) : QDialog(parent, Qt::Window) { QFile styleSheet(PathUtils::resourcesPath() + "styles/log_dialog.qss"); if (styleSheet.open(QIODevice::ReadOnly)) { - QDir::setCurrent(PathUtils::resourcesPath()); setStyleSheet(styleSheet.readAll()); } From 537db37b2634fbf3577da28de665d61b5556e763 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Thu, 25 Jan 2018 16:23:35 -0800 Subject: [PATCH 09/10] removed dead comment --- .../dressing_room/.#doppelganger.js | 1 + script-archive/dressing_room/doppelganger.js | 30 +++++++++---------- 2 files changed, 15 insertions(+), 16 deletions(-) create mode 100644 script-archive/dressing_room/.#doppelganger.js diff --git a/script-archive/dressing_room/.#doppelganger.js b/script-archive/dressing_room/.#doppelganger.js new file mode 100644 index 0000000000..63b1f8f93c --- /dev/null +++ b/script-archive/dressing_room/.#doppelganger.js @@ -0,0 +1 @@ +dante@0228-DESKTOP-PC.9420:1516899782 \ No newline at end of file diff --git a/script-archive/dressing_room/doppelganger.js b/script-archive/dressing_room/doppelganger.js index 8ff62ff665..773a5d974b 100644 --- a/script-archive/dressing_room/doppelganger.js +++ b/script-archive/dressing_room/doppelganger.js @@ -32,7 +32,7 @@ function Doppelganger(avatar) { script: FREEZE_TOGGLER_SCRIPT_URL, userData: JSON.stringify({ grabbableKey: { - grabbable: true, + grabbable: false, wantsTrigger: true } }) @@ -64,7 +64,6 @@ function setJointData(doppelganger, relativeXforms) { var i, l = relativeXforms.length; for (i = 0; i < l; i++) { jointRotations.push(relativeXforms[i].rot); - //Entities.setAbsoluteJointRotationInObjectFrame(doppelganger.id, i, relativeXforms[i].rot); } Entities.setLocalJointRotations(doppelganger.id, jointRotations); @@ -206,7 +205,7 @@ function Xform(rot, pos) { }; Xform.ident = function () { return new Xform({x: 0, y: 0, z: 0, w: 1}, {x: 0, y: 0, z: 0}); -} +}; Xform.mul = function (lhs, rhs) { var rot = Quat.multiply(lhs.rot, rhs.rot); var pos = Vec3.sum(lhs.pos, Vec3.multiplyQbyV(lhs.rot, rhs.pos)); @@ -354,12 +353,12 @@ function getAvatarFootOffset() { if (jointName === "RightToe_End") { toeTop = d.translation.y } - }) + }); var myPosition = MyAvatar.position; var offset = upperLeg + lowerLeg + foot + toe + toeTop; offset = offset / 100; - return offset + return offset; } @@ -545,15 +544,15 @@ function mirrorEntitiesForDoppelganger(doppelganger, parsedMessage) { baseEntity: baseEntity, doppelganger: doppelganger.id } - }) + }); var mirrorEntity = Entities.addEntity(wearableProps); - var mirrorEntityProps = Entities.getEntityProperties(mirrorEntity) - print('MIRROR PROPS::' + JSON.stringify(mirrorEntityProps)) + var mirrorEntityProps = Entities.getEntityProperties(mirrorEntity); + print('MIRROR PROPS::' + JSON.stringify(mirrorEntityProps)); var wearablePair = { baseEntity: baseEntity, mirrorEntity: mirrorEntity - } + }; wearablePairs.push(wearablePair); } @@ -563,11 +562,11 @@ function mirrorEntitiesForDoppelganger(doppelganger, parsedMessage) { var mirrorEntity = getMirrorEntityForBaseEntity(baseEntity); // print('MIRROR ENTITY, newPosition' + mirrorEntity + ":::" + JSON.stringify(newPosition)) - Entities.editEntity(mirrorEntity, wearableProps) + Entities.editEntity(mirrorEntity, wearableProps); } if (action === 'remove') { - Entities.deleteEntity(getMirrorEntityForBaseEntity(baseEntity)) + Entities.deleteEntity(getMirrorEntityForBaseEntity(baseEntity)); wearablePairs = wearablePairs.filter(function(obj) { return obj.baseEntity !== baseEntity; }); @@ -575,7 +574,7 @@ function mirrorEntitiesForDoppelganger(doppelganger, parsedMessage) { if (action === 'updateBase') { //this gets called when the mirrored entity gets grabbed. now we move the - var mirrorEntityProperties = Entities.getEntityProperties(message.mirrorEntity) + var mirrorEntityProperties = Entities.getEntityProperties(message.mirrorEntity); var doppelgangerToMirrorEntity = Vec3.subtract(doppelgangerProps.position, mirrorEntityProperties.position); var newPosition = Vec3.sum(MyAvatar.position, doppelgangerToMirrorEntity); @@ -596,7 +595,7 @@ function getMirrorEntityForBaseEntity(baseEntity) { if (result.length === 0) { return false; } else { - return result[0].mirrorEntity + return result[0].mirrorEntity; } } @@ -607,13 +606,12 @@ function getBaseEntityForMirrorEntity(mirrorEntity) { if (result.length === 0) { return false; } else { - return result[0].baseEntity + return result[0].baseEntity; } } makeDoppelgangerForMyAvatar(); subscribeToWearableMessages(); -//subscribeToWearableMessagesForAvatar(); subscribeToFreezeMessages(); function cleanup() { @@ -622,7 +620,7 @@ function cleanup() { } doppelgangers.forEach(function(doppelganger) { - print('DOPPELGANGER' + doppelganger.id) + print('DOPPELGANGER' + doppelganger.id); Entities.deleteEntity(doppelganger.id); }); } From 5bb1b1bbffb006d651d9f9d74904bec9f725e5d9 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Thu, 25 Jan 2018 16:26:00 -0800 Subject: [PATCH 10/10] remove backup file --- script-archive/dressing_room/.#doppelganger.js | 1 - 1 file changed, 1 deletion(-) delete mode 100644 script-archive/dressing_room/.#doppelganger.js diff --git a/script-archive/dressing_room/.#doppelganger.js b/script-archive/dressing_room/.#doppelganger.js deleted file mode 100644 index 63b1f8f93c..0000000000 --- a/script-archive/dressing_room/.#doppelganger.js +++ /dev/null @@ -1 +0,0 @@ -dante@0228-DESKTOP-PC.9420:1516899782 \ No newline at end of file