mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 10:43:45 +02:00
Revert "fix importing of avatar entities"
This commit is contained in:
parent
62fc193bff
commit
28a8b18060
6 changed files with 9 additions and 39 deletions
|
@ -3238,9 +3238,3 @@ void MyAvatar::setModelScale(float scale) {
|
||||||
emit sensorToWorldScaleChanged(sensorToWorldScale);
|
emit sensorToWorldScaleChanged(sensorToWorldScale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SpatialParentTree* MyAvatar::getParentTree() const {
|
|
||||||
auto entityTreeRenderer = qApp->getEntities();
|
|
||||||
EntityTreePointer entityTree = entityTreeRenderer ? entityTreeRenderer->getTree() : nullptr;
|
|
||||||
return entityTree.get();
|
|
||||||
}
|
|
||||||
|
|
|
@ -544,8 +544,6 @@ public:
|
||||||
float getUserHeight() const;
|
float getUserHeight() const;
|
||||||
float getUserEyeHeight() const;
|
float getUserEyeHeight() const;
|
||||||
|
|
||||||
virtual SpatialParentTree* getParentTree() const override;
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void increaseSize();
|
void increaseSize();
|
||||||
void decreaseSize();
|
void decreaseSize();
|
||||||
|
|
|
@ -45,7 +45,7 @@ void EntityEditPacketSender::queueEditAvatarEntityMessage(PacketType type,
|
||||||
}
|
}
|
||||||
EntityItemPointer entity = entityTree->findEntityByEntityItemID(entityItemID);
|
EntityItemPointer entity = entityTree->findEntityByEntityItemID(entityItemID);
|
||||||
if (!entity) {
|
if (!entity) {
|
||||||
qCDebug(entities) << "EntityEditPacketSender::queueEditAvatarEntityMessage can't find entity: " << entityItemID;
|
qCDebug(entities) << "EntityEditPacketSender::queueEditEntityMessage can't find entity.";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1842,13 +1842,7 @@ bool EntityTree::sendEntitiesOperation(const OctreeElementPointer& element, void
|
||||||
|
|
||||||
QHash<EntityItemID, EntityItemID>::iterator iter = args->map->find(oldID);
|
QHash<EntityItemID, EntityItemID>::iterator iter = args->map->find(oldID);
|
||||||
if (iter == args->map->end()) {
|
if (iter == args->map->end()) {
|
||||||
EntityItemID newID;
|
EntityItemID newID = QUuid::createUuid();
|
||||||
if (oldID == AVATAR_SELF_ID) {
|
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
|
||||||
newID = EntityItemID(nodeList->getSessionUUID());
|
|
||||||
} else {
|
|
||||||
newID = QUuid::createUuid();
|
|
||||||
}
|
|
||||||
args->map->insert(oldID, newID);
|
args->map->insert(oldID, newID);
|
||||||
return newID;
|
return newID;
|
||||||
}
|
}
|
||||||
|
@ -1865,8 +1859,8 @@ bool EntityTree::sendEntitiesOperation(const OctreeElementPointer& element, void
|
||||||
properties.setPosition(properties.getPosition() + args->root);
|
properties.setPosition(properties.getPosition() + args->root);
|
||||||
} else {
|
} else {
|
||||||
EntityItemPointer parentEntity = args->ourTree->findEntityByEntityItemID(oldParentID);
|
EntityItemPointer parentEntity = args->ourTree->findEntityByEntityItemID(oldParentID);
|
||||||
if (parentEntity || oldParentID == AVATAR_SELF_ID) { // map the parent
|
if (parentEntity) { // map the parent
|
||||||
properties.setParentID(getMapped(oldParentID));
|
properties.setParentID(getMapped(parentEntity->getID()));
|
||||||
// But do not add root offset in this case.
|
// But do not add root offset in this case.
|
||||||
} else { // Should not happen, but let's try to be helpful...
|
} else { // Should not happen, but let's try to be helpful...
|
||||||
item->globalizeProperties(properties, "Cannot find %3 parent of %2 %1", args->root);
|
item->globalizeProperties(properties, "Cannot find %3 parent of %2 %1", args->root);
|
||||||
|
@ -1941,12 +1935,6 @@ bool EntityTree::readFromMap(QVariantMap& map) {
|
||||||
entityItemID = EntityItemID(QUuid::createUuid());
|
entityItemID = EntityItemID(QUuid::createUuid());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (properties.getClientOnly()) {
|
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
|
||||||
const QUuid myNodeID = nodeList->getSessionUUID();
|
|
||||||
properties.setOwningAvatarID(myNodeID);
|
|
||||||
}
|
|
||||||
|
|
||||||
EntityItemPointer entity = addEntity(entityItemID, properties);
|
EntityItemPointer entity = addEntity(entityItemID, properties);
|
||||||
if (!entity) {
|
if (!entity) {
|
||||||
qCDebug(entities) << "adding Entity failed:" << entityItemID << properties.getType();
|
qCDebug(entities) << "adding Entity failed:" << entityItemID << properties.getType();
|
||||||
|
|
|
@ -102,11 +102,8 @@ SpatiallyNestablePointer SpatiallyNestable::getParentPointer(bool& success) cons
|
||||||
if (parent && parent->getID() == parentID) {
|
if (parent && parent->getID() == parentID) {
|
||||||
// parent pointer is up-to-date
|
// parent pointer is up-to-date
|
||||||
if (!_parentKnowsMe) {
|
if (!_parentKnowsMe) {
|
||||||
SpatialParentTree* parentTree = parent->getParentTree();
|
parent->beParentOfChild(getThisPointer());
|
||||||
if (!parentTree || parentTree == getParentTree()) {
|
_parentKnowsMe = true;
|
||||||
parent->beParentOfChild(getThisPointer());
|
|
||||||
_parentKnowsMe = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
success = true;
|
success = true;
|
||||||
return parent;
|
return parent;
|
||||||
|
@ -132,15 +129,8 @@ SpatiallyNestablePointer SpatiallyNestable::getParentPointer(bool& success) cons
|
||||||
|
|
||||||
parent = _parent.lock();
|
parent = _parent.lock();
|
||||||
if (parent) {
|
if (parent) {
|
||||||
|
parent->beParentOfChild(getThisPointer());
|
||||||
// it's possible for an entity with a parent of AVATAR_SELF_ID can be imported into a side-tree
|
_parentKnowsMe = true;
|
||||||
// such as the clipboard's. if this is the case, we don't want the parent to consider this a
|
|
||||||
// child.
|
|
||||||
SpatialParentTree* parentTree = parent->getParentTree();
|
|
||||||
if (!parentTree || parentTree == getParentTree()) {
|
|
||||||
parent->beParentOfChild(getThisPointer());
|
|
||||||
_parentKnowsMe = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
success = (parent || parentID.isNull());
|
success = (parent || parentID.isNull());
|
||||||
|
|
|
@ -222,7 +222,7 @@ getControllerJointIndex = function (hand) {
|
||||||
return controllerJointIndex;
|
return controllerJointIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return MyAvatar.getJointIndex("Head");
|
||||||
};
|
};
|
||||||
|
|
||||||
propsArePhysical = function (props) {
|
propsArePhysical = function (props) {
|
||||||
|
|
Loading…
Reference in a new issue