From 630d95a812f8a52f67dab8e6169633472b35953e Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Fri, 12 May 2017 13:03:51 -0700 Subject: [PATCH] fix constraint import some more --- libraries/entities/src/EntityTree.cpp | 3 ++- libraries/physics/src/ObjectConstraintBallSocket.cpp | 8 +++----- libraries/physics/src/ObjectDynamic.cpp | 3 ++- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index 04a8e89fef..457b7c21f6 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -1622,7 +1622,8 @@ bool EntityTree::sendEntitiesOperation(OctreeElementPointer element, void* extra }; entityTreeElement->forEachEntity([&args, &getMapped, &element](EntityItemPointer item) { - EntityItemID newID = getMapped(item->getEntityItemID()); + EntityItemID oldID = item->getEntityItemID(); + EntityItemID newID = getMapped(oldID); EntityItemProperties properties = item->getProperties(); EntityItemID oldParentID = properties.getParentID(); diff --git a/libraries/physics/src/ObjectConstraintBallSocket.cpp b/libraries/physics/src/ObjectConstraintBallSocket.cpp index 4b6e72092e..fb36a49e92 100644 --- a/libraries/physics/src/ObjectConstraintBallSocket.cpp +++ b/libraries/physics/src/ObjectConstraintBallSocket.cpp @@ -178,11 +178,9 @@ bool ObjectConstraintBallSocket::updateArguments(QVariantMap arguments) { QVariantMap ObjectConstraintBallSocket::getArguments() { QVariantMap arguments = ObjectDynamic::getArguments(); withReadLock([&] { - if (_constraint) { - arguments["pivot"] = glmToQMap(_pivotInA); - arguments["otherEntityID"] = _otherID; - arguments["otherPivot"] = glmToQMap(_pivotInB); - } + arguments["pivot"] = glmToQMap(_pivotInA); + arguments["otherEntityID"] = _otherID; + arguments["otherPivot"] = glmToQMap(_pivotInB); }); return arguments; } diff --git a/libraries/physics/src/ObjectDynamic.cpp b/libraries/physics/src/ObjectDynamic.cpp index 16be10a8f0..253739375a 100644 --- a/libraries/physics/src/ObjectDynamic.cpp +++ b/libraries/physics/src/ObjectDynamic.cpp @@ -35,8 +35,9 @@ void ObjectDynamic::remapIDs(QHash& map) { QHash::iterator iter = map.find(_otherID); if (iter == map.end()) { // not found, add it + QUuid oldOtherID = _otherID; _otherID = QUuid::createUuid(); - map.insert(_otherID, _otherID); + map.insert(oldOtherID, _otherID); } else { _otherID = iter.value(); }