don't allow tablet to get stuck to a hand when passing it back and forth between hands

This commit is contained in:
Seth Alves 2017-02-24 12:10:52 -08:00
parent 71ab6a1a84
commit eedc5c1647
2 changed files with 5 additions and 2 deletions

View file

@ -1419,8 +1419,7 @@ QVector<QUuid> EntityScriptingInterface::getChildrenIDsOfJoint(const QUuid& pare
return; return;
} }
parent->forEachChild([&](SpatiallyNestablePointer child) { parent->forEachChild([&](SpatiallyNestablePointer child) {
if (child->getParentJointIndex() == jointIndex && if (child->getParentJointIndex() == jointIndex) {
child->getNestableType() != NestableType::Overlay) {
result.push_back(child->getID()); result.push_back(child->getID());
} }
}); });

View file

@ -3213,9 +3213,13 @@ function MyController(hand) {
} }
_this.previouslyUnhooked[childID] = now; _this.previouslyUnhooked[childID] = now;
// we don't know if it's an entity or an overlay
Entities.editEntity(childID, { parentID: previousParentID, parentJointIndex: previousParentJointIndex }); Entities.editEntity(childID, { parentID: previousParentID, parentJointIndex: previousParentJointIndex });
Overlays.editOverlay(childID, { parentID: previousParentID, parentJointIndex: previousParentJointIndex });
} else { } else {
Entities.editEntity(childID, { parentID: NULL_UUID }); Entities.editEntity(childID, { parentID: NULL_UUID });
Overlays.editOverlay(childID, { parentID: NULL_UUID });
} }
} }
}); });