mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 19:02:55 +02:00
kill offsets
This commit is contained in:
parent
1b3d9d7ab6
commit
5db1c33e4d
4 changed files with 12 additions and 13 deletions
|
@ -2849,12 +2849,13 @@ bool Application::exportEntities(const QString& filename, const QVector<EntityIt
|
||||||
}
|
}
|
||||||
// The so-called root offset (which isn't) is confusing and not what content developers want. And why would queryAACube not then be offset?
|
// The so-called root offset (which isn't) is confusing and not what content developers want. And why would queryAACube not then be offset?
|
||||||
// But leaving it in for bug-compatibility right now. -HRS
|
// But leaving it in for bug-compatibility right now. -HRS
|
||||||
properties.setPosition(properties.getPosition() - root);
|
// FIXME properties.setPosition(properties.getPosition() - root);
|
||||||
datum.mappedID = originalID; //EntityItemID(QUuid::createUuid());
|
datum.mappedID = originalID; //EntityItemID(QUuid::createUuid());
|
||||||
auto newEntity = exportTree->addEntity(datum.mappedID, properties);
|
auto newEntity = exportTree->addEntity(datum.mappedID, properties);
|
||||||
qCDebug(interfaceapp) << "mapped" << properties.getName();
|
qCDebug(interfaceapp) << "mapped" << properties.getName();
|
||||||
qCDebug(interfaceapp) << " " << originalID << "p:" << datum.originalParentID;
|
qCDebug(interfaceapp) << " " << originalID << "p:" << datum.originalParentID;
|
||||||
qCDebug(interfaceapp) << " =>" << datum.mappedID << "p:" << parentID;
|
qCDebug(interfaceapp) << " =>" << datum.mappedID << "p:" << parentID;
|
||||||
|
qCDebug(interfaceapp) << " @" << properties.getPosition() << "/" << properties.getLocalPosition();
|
||||||
|
|
||||||
return datum.mappedID;
|
return datum.mappedID;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1335,12 +1335,13 @@ bool EntityTree::sendEntitiesOperation(OctreeElementPointer element, void* extra
|
||||||
SendEntitiesOperationArgs* args = static_cast<SendEntitiesOperationArgs*>(extraData);
|
SendEntitiesOperationArgs* args = static_cast<SendEntitiesOperationArgs*>(extraData);
|
||||||
EntityTreeElementPointer entityTreeElement = std::static_pointer_cast<EntityTreeElement>(element);
|
EntityTreeElementPointer entityTreeElement = std::static_pointer_cast<EntityTreeElement>(element);
|
||||||
entityTreeElement->forEachEntity([&](EntityItemPointer entityItem) {
|
entityTreeElement->forEachEntity([&](EntityItemPointer entityItem) {
|
||||||
EntityItemID newID = entityItem->getEntityItemID(); // FIXME (QUuid::createUuid());
|
EntityItemID newID = /*entityItem->getEntityItemID(); // FIXME*/ (QUuid::createUuid());
|
||||||
|
// FIXME: add map to SendEntitiesOperationArgs, and recurse through parent using the map
|
||||||
args->newEntityIDs->append(newID);
|
args->newEntityIDs->append(newID);
|
||||||
EntityItemProperties properties = entityItem->getProperties();
|
EntityItemProperties properties = entityItem->getProperties();
|
||||||
properties.setPosition(properties.getPosition() + args->root);
|
//FIXME properties.setPosition(properties.getPosition() + args->root);
|
||||||
properties.markAllChanged(); // so the entire property set is considered new, since we're making a new entity
|
properties.markAllChanged(); // so the entire property set is considered new, since we're making a new entity
|
||||||
qCDebug(entities) << "sending" << newID << properties.getName() << "parent:" << properties.getParentID();
|
qCDebug(entities) << "sending" << newID << properties.getName() << "parent:" << properties.getParentID() << "pos:" << properties.getPosition();
|
||||||
|
|
||||||
// queue the packet to send to the server
|
// queue the packet to send to the server
|
||||||
args->packetSender->queueEditEntityMessage(PacketType::EntityAdd, newID, properties);
|
args->packetSender->queueEditEntityMessage(PacketType::EntityAdd, newID, properties);
|
||||||
|
@ -1367,7 +1368,7 @@ bool EntityTree::writeToMap(QVariantMap& entityDescription, OctreeElementPointer
|
||||||
entityDescription["Entities"] = QVariantList();
|
entityDescription["Entities"] = QVariantList();
|
||||||
}
|
}
|
||||||
QScriptEngine scriptEngine;
|
QScriptEngine scriptEngine;
|
||||||
RecurseOctreeToMapOperator theOperator(entityDescription, element, &scriptEngine, skipDefaultValues, skipThoseWithBadParents, this);
|
RecurseOctreeToMapOperator theOperator(entityDescription, element, &scriptEngine, skipDefaultValues, skipThoseWithBadParents);
|
||||||
recurseTreeWithOperator(&theOperator);
|
recurseTreeWithOperator(&theOperator);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1395,7 +1396,7 @@ bool EntityTree::readFromMap(QVariantMap& map) {
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityItemPointer entity = addEntity(entityItemID, properties);
|
EntityItemPointer entity = addEntity(entityItemID, properties);
|
||||||
qCDebug(entities) << "HRS FIXME added" << entityItemID << properties.getName();
|
qCDebug(entities) << "HRS FIXME added" << entityItemID << properties.getName() << "@" << properties.getPosition();
|
||||||
if (!entity) {
|
if (!entity) {
|
||||||
qCDebug(entities) << "adding Entity failed:" << entityItemID << properties.getType();
|
qCDebug(entities) << "adding Entity failed:" << entityItemID << properties.getType();
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,15 +17,13 @@ RecurseOctreeToMapOperator::RecurseOctreeToMapOperator(QVariantMap& map,
|
||||||
OctreeElementPointer top,
|
OctreeElementPointer top,
|
||||||
QScriptEngine* engine,
|
QScriptEngine* engine,
|
||||||
bool skipDefaultValues,
|
bool skipDefaultValues,
|
||||||
bool skipThoseWithBadParents,
|
bool skipThoseWithBadParents) :
|
||||||
EntityTree* tree) :
|
|
||||||
RecurseOctreeOperator(),
|
RecurseOctreeOperator(),
|
||||||
_map(map),
|
_map(map),
|
||||||
_top(top),
|
_top(top),
|
||||||
_engine(engine),
|
_engine(engine),
|
||||||
_skipDefaultValues(skipDefaultValues),
|
_skipDefaultValues(skipDefaultValues),
|
||||||
_skipThoseWithBadParents(skipThoseWithBadParents),
|
_skipThoseWithBadParents(skipThoseWithBadParents)
|
||||||
_entityTree(tree)
|
|
||||||
{
|
{
|
||||||
// if some element "top" was given, only save information for that element and its children.
|
// if some element "top" was given, only save information for that element and its children.
|
||||||
if (_top) {
|
if (_top) {
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
class RecurseOctreeToMapOperator : public RecurseOctreeOperator {
|
class RecurseOctreeToMapOperator : public RecurseOctreeOperator {
|
||||||
public:
|
public:
|
||||||
RecurseOctreeToMapOperator(QVariantMap& map, OctreeElementPointer top, QScriptEngine* engine, bool skipDefaultValues,
|
RecurseOctreeToMapOperator(QVariantMap& map, OctreeElementPointer top, QScriptEngine* engine, bool skipDefaultValues,
|
||||||
bool skipThoseWithBadParents, EntityTree* tree);
|
bool skipThoseWithBadParents);
|
||||||
bool preRecursion(OctreeElementPointer element);
|
bool preRecursion(OctreeElementPointer element);
|
||||||
bool postRecursion(OctreeElementPointer element);
|
bool postRecursion(OctreeElementPointer element);
|
||||||
private:
|
private:
|
||||||
|
@ -24,5 +24,4 @@ public:
|
||||||
bool _withinTop;
|
bool _withinTop;
|
||||||
bool _skipDefaultValues;
|
bool _skipDefaultValues;
|
||||||
bool _skipThoseWithBadParents;
|
bool _skipThoseWithBadParents;
|
||||||
EntityTree* _entityTree;
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue