mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 14:29:35 +02:00
Merge pull request #9553 from huffman/fix/polyvox-import
Fix importing of PolyVox entities
This commit is contained in:
commit
619bcdeed8
1 changed files with 39 additions and 1 deletions
|
@ -1560,6 +1560,8 @@ bool EntityTree::sendEntitiesOperation(OctreeElementPointer element, void* extra
|
|||
return args->map->value(oldID);
|
||||
}
|
||||
EntityItemID newID = QUuid::createUuid();
|
||||
args->map->insert(oldID, newID);
|
||||
|
||||
EntityItemProperties properties = item->getProperties();
|
||||
EntityItemID oldParentID = properties.getParentID();
|
||||
if (oldParentID.isInvalidID()) { // no parent
|
||||
|
@ -1575,6 +1577,43 @@ bool EntityTree::sendEntitiesOperation(OctreeElementPointer element, void* extra
|
|||
}
|
||||
}
|
||||
|
||||
if (!properties.getXNNeighborID().isInvalidID()) {
|
||||
auto neighborEntity = args->ourTree->findEntityByEntityItemID(properties.getXNNeighborID());
|
||||
if (neighborEntity) {
|
||||
properties.setXNNeighborID(getMapped(neighborEntity));
|
||||
}
|
||||
}
|
||||
if (!properties.getXPNeighborID().isInvalidID()) {
|
||||
auto neighborEntity = args->ourTree->findEntityByEntityItemID(properties.getXPNeighborID());
|
||||
if (neighborEntity) {
|
||||
properties.setXPNeighborID(getMapped(neighborEntity));
|
||||
}
|
||||
}
|
||||
if (!properties.getYNNeighborID().isInvalidID()) {
|
||||
auto neighborEntity = args->ourTree->findEntityByEntityItemID(properties.getYNNeighborID());
|
||||
if (neighborEntity) {
|
||||
properties.setYNNeighborID(getMapped(neighborEntity));
|
||||
}
|
||||
}
|
||||
if (!properties.getYPNeighborID().isInvalidID()) {
|
||||
auto neighborEntity = args->ourTree->findEntityByEntityItemID(properties.getYPNeighborID());
|
||||
if (neighborEntity) {
|
||||
properties.setYPNeighborID(getMapped(neighborEntity));
|
||||
}
|
||||
}
|
||||
if (!properties.getZNNeighborID().isInvalidID()) {
|
||||
auto neighborEntity = args->ourTree->findEntityByEntityItemID(properties.getZNNeighborID());
|
||||
if (neighborEntity) {
|
||||
properties.setZNNeighborID(getMapped(neighborEntity));
|
||||
}
|
||||
}
|
||||
if (!properties.getZPNeighborID().isInvalidID()) {
|
||||
auto neighborEntity = args->ourTree->findEntityByEntityItemID(properties.getZPNeighborID());
|
||||
if (neighborEntity) {
|
||||
properties.setZPNeighborID(getMapped(neighborEntity));
|
||||
}
|
||||
}
|
||||
|
||||
// set creation time to "now" for imported entities
|
||||
properties.setCreated(usecTimestampNow());
|
||||
|
||||
|
@ -1592,7 +1631,6 @@ bool EntityTree::sendEntitiesOperation(OctreeElementPointer element, void* extra
|
|||
args->otherTree->addEntity(newID, properties);
|
||||
});
|
||||
}
|
||||
args->map->insert(oldID, newID);
|
||||
return newID;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue