mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 11:58:37 +02:00
cleanups
This commit is contained in:
parent
1c23f3b971
commit
4f24a7618a
2 changed files with 14 additions and 26 deletions
|
@ -1531,6 +1531,10 @@ void EntityTree::pruneTree() {
|
||||||
|
|
||||||
|
|
||||||
QByteArray EntityTree::remapActionDataIDs(QByteArray actionData, QHash<EntityItemID, EntityItemID>& map) {
|
QByteArray EntityTree::remapActionDataIDs(QByteArray actionData, QHash<EntityItemID, EntityItemID>& map) {
|
||||||
|
if (actionData.isEmpty()) {
|
||||||
|
return actionData;
|
||||||
|
}
|
||||||
|
|
||||||
QDataStream serializedActionsStream(actionData);
|
QDataStream serializedActionsStream(actionData);
|
||||||
QVector<QByteArray> serializedActions;
|
QVector<QByteArray> serializedActions;
|
||||||
serializedActionsStream >> serializedActions;
|
serializedActionsStream >> serializedActions;
|
||||||
|
@ -1617,11 +1621,9 @@ bool EntityTree::sendEntitiesOperation(OctreeElementPointer element, void* extra
|
||||||
};
|
};
|
||||||
|
|
||||||
entityTreeElement->forEachEntity([&args, &getMapped, &element](EntityItemPointer item) {
|
entityTreeElement->forEachEntity([&args, &getMapped, &element](EntityItemPointer item) {
|
||||||
|
EntityItemID newID = getMapped(item->getEntityItemID());
|
||||||
EntityItemID oldID = item->getEntityItemID();
|
|
||||||
EntityItemID newID = getMapped(oldID);
|
|
||||||
|
|
||||||
EntityItemProperties properties = item->getProperties();
|
EntityItemProperties properties = item->getProperties();
|
||||||
|
|
||||||
EntityItemID oldParentID = properties.getParentID();
|
EntityItemID oldParentID = properties.getParentID();
|
||||||
if (oldParentID.isInvalidID()) { // no parent
|
if (oldParentID.isInvalidID()) { // no parent
|
||||||
properties.setPosition(properties.getPosition() + args->root);
|
properties.setPosition(properties.getPosition() + args->root);
|
||||||
|
@ -1635,29 +1637,15 @@ bool EntityTree::sendEntitiesOperation(OctreeElementPointer element, void* extra
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!properties.getXNNeighborID().isInvalidID()) {
|
properties.setXNNeighborID(getMapped(properties.getXNNeighborID()));
|
||||||
properties.setXNNeighborID(getMapped(properties.getXNNeighborID()));
|
properties.setXPNeighborID(getMapped(properties.getXPNeighborID()));
|
||||||
}
|
properties.setYNNeighborID(getMapped(properties.getYNNeighborID()));
|
||||||
if (!properties.getXPNeighborID().isInvalidID()) {
|
properties.setYPNeighborID(getMapped(properties.getYPNeighborID()));
|
||||||
properties.setXPNeighborID(getMapped(properties.getXPNeighborID()));
|
properties.setZNNeighborID(getMapped(properties.getZNNeighborID()));
|
||||||
}
|
properties.setZPNeighborID(getMapped(properties.getZPNeighborID()));
|
||||||
if (!properties.getYNNeighborID().isInvalidID()) {
|
|
||||||
properties.setYNNeighborID(getMapped(properties.getYNNeighborID()));
|
|
||||||
}
|
|
||||||
if (!properties.getYPNeighborID().isInvalidID()) {
|
|
||||||
properties.setYPNeighborID(getMapped(properties.getYPNeighborID()));
|
|
||||||
}
|
|
||||||
if (!properties.getZNNeighborID().isInvalidID()) {
|
|
||||||
properties.setZNNeighborID(getMapped(properties.getZNNeighborID()));
|
|
||||||
}
|
|
||||||
if (!properties.getZPNeighborID().isInvalidID()) {
|
|
||||||
properties.setZPNeighborID(getMapped(properties.getZPNeighborID()));
|
|
||||||
}
|
|
||||||
|
|
||||||
QByteArray actionData = properties.getActionData();
|
QByteArray actionData = properties.getActionData();
|
||||||
if (!actionData.isEmpty()) {
|
properties.setActionData(remapActionDataIDs(actionData, *args->map));
|
||||||
properties.setActionData(remapActionDataIDs(actionData, *args->map));
|
|
||||||
}
|
|
||||||
|
|
||||||
// set creation time to "now" for imported entities
|
// set creation time to "now" for imported entities
|
||||||
properties.setCreated(usecTimestampNow());
|
properties.setCreated(usecTimestampNow());
|
||||||
|
|
|
@ -57,7 +57,7 @@ void ObjectActionMotor::updateActionWorker(btScalar deltaTimeStep) {
|
||||||
|
|
||||||
if (_angularTimeScale < MAX_MOTOR_TIMESCALE) {
|
if (_angularTimeScale < MAX_MOTOR_TIMESCALE) {
|
||||||
|
|
||||||
if (_otherID != QUuid()) {
|
if (!_otherID.isEmpty()) {
|
||||||
if (other) {
|
if (other) {
|
||||||
glm::vec3 otherAngularVelocity = other->getAngularVelocity();
|
glm::vec3 otherAngularVelocity = other->getAngularVelocity();
|
||||||
rigidBody->setAngularVelocity(glmToBullet(_angularVelocityTarget + otherAngularVelocity));
|
rigidBody->setAngularVelocity(glmToBullet(_angularVelocityTarget + otherAngularVelocity));
|
||||||
|
|
Loading…
Reference in a new issue