mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-01 22:21:14 +02:00
remove some redundancy
This commit is contained in:
parent
a45b5599c9
commit
a442181859
1 changed files with 15 additions and 29 deletions
|
@ -1369,10 +1369,9 @@ bool EntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(lastEditedBy, setLastEditedBy);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(lastEditedBy, setLastEditedBy);
|
||||||
|
|
||||||
AACube saveQueryAACube = _queryAACube;
|
AACube saveQueryAACube = _queryAACube;
|
||||||
if (checkAndAdjustQueryAACube()) {
|
checkAndAdjustQueryAACube();
|
||||||
if (saveQueryAACube != _queryAACube) {
|
if (saveQueryAACube != _queryAACube) {
|
||||||
somethingChanged = true;
|
somethingChanged = true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now check the sub classes
|
// Now check the sub classes
|
||||||
|
@ -1609,46 +1608,33 @@ void EntityItem::updatePosition(const glm::vec3& value) {
|
||||||
setLocalPosition(value);
|
setLocalPosition(value);
|
||||||
|
|
||||||
EntityTreePointer tree = getTree();
|
EntityTreePointer tree = getTree();
|
||||||
if (!tree) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
markDirtyFlags(Simulation::DIRTY_POSITION);
|
markDirtyFlags(Simulation::DIRTY_POSITION);
|
||||||
tree->entityChanged(getThisPointer());
|
if (tree) {
|
||||||
|
tree->entityChanged(getThisPointer());
|
||||||
|
}
|
||||||
forEachDescendant([&](SpatiallyNestablePointer object) {
|
forEachDescendant([&](SpatiallyNestablePointer object) {
|
||||||
if (object->getNestableType() == NestableType::Entity) {
|
if (object->getNestableType() == NestableType::Entity) {
|
||||||
EntityItemPointer entity = std::static_pointer_cast<EntityItem>(object);
|
EntityItemPointer entity = std::static_pointer_cast<EntityItem>(object);
|
||||||
entity->markDirtyFlags(Simulation::DIRTY_POSITION);
|
entity->markDirtyFlags(Simulation::DIRTY_POSITION);
|
||||||
tree->entityChanged(entity);
|
if (tree) {
|
||||||
|
tree->entityChanged(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
locationChanged();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityItem::updateParentID(const QUuid& value) {
|
void EntityItem::updateParentID(const QUuid& value) {
|
||||||
if (getParentID() != value) {
|
if (getParentID() != value) {
|
||||||
setParentID(value);
|
setParentID(value);
|
||||||
|
|
||||||
EntityTreePointer tree = getTree();
|
|
||||||
if (!tree) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// children are forced to be kinematic
|
// children are forced to be kinematic
|
||||||
// may need to not collide with own avatar
|
// may need to not collide with own avatar
|
||||||
markDirtyFlags(Simulation::DIRTY_MOTION_TYPE | Simulation::DIRTY_COLLISION_GROUP | Simulation::DIRTY_TRANSFORM);
|
markDirtyFlags(Simulation::DIRTY_MOTION_TYPE | Simulation::DIRTY_COLLISION_GROUP);
|
||||||
tree->entityChanged(getThisPointer());
|
|
||||||
forEachDescendant([&](SpatiallyNestablePointer object) {
|
EntityTreePointer tree = getTree();
|
||||||
if (object->getNestableType() == NestableType::Entity) {
|
if (tree) {
|
||||||
EntityItemPointer entity = std::static_pointer_cast<EntityItem>(object);
|
tree->addToNeedsParentFixupList(getThisPointer());
|
||||||
entity->markDirtyFlags(Simulation::DIRTY_MOTION_TYPE |
|
}
|
||||||
Simulation::DIRTY_COLLISION_GROUP |
|
|
||||||
Simulation::DIRTY_TRANSFORM);
|
|
||||||
tree->entityChanged(entity);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
locationChanged();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue