mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 16:50:43 +02:00
use parentChanged to recalculate entity bounding boxes
This commit is contained in:
parent
ffb0317a50
commit
9b3708ea66
4 changed files with 9 additions and 2 deletions
|
@ -1324,6 +1324,12 @@ void EntityItem::forSelfAndEachChildEntity(std::function<void(EntityItemPointer)
|
|||
}
|
||||
}
|
||||
|
||||
void EntityItem::parentChanged() {
|
||||
forSelfAndEachChildEntity([&](EntityItemPointer entity) {
|
||||
entity->requiresRecalcBoxes();
|
||||
});
|
||||
}
|
||||
|
||||
void EntityItem::updatePosition(const glm::vec3& value) {
|
||||
if (shouldSuppressLocationEdits()) {
|
||||
return;
|
||||
|
|
|
@ -398,6 +398,7 @@ protected:
|
|||
void setActionDataInternal(QByteArray actionData);
|
||||
|
||||
void forSelfAndEachChildEntity(std::function<void(EntityItemPointer)> actor);
|
||||
virtual void parentChanged();
|
||||
|
||||
static bool _sendPhysicsUpdates;
|
||||
EntityTypes::EntityType _type;
|
||||
|
|
|
@ -71,7 +71,7 @@ SpatiallyNestablePointer SpatiallyNestable::getParentPointer() const {
|
|||
}
|
||||
|
||||
if (parent || _parentID.isNull()) {
|
||||
parentChanged();
|
||||
thisPointer->parentChanged();
|
||||
}
|
||||
|
||||
return parent;
|
||||
|
|
|
@ -92,7 +92,7 @@ protected:
|
|||
virtual void forgetChild(SpatiallyNestablePointer newChild) const;
|
||||
mutable QHash<QUuid, SpatiallyNestableWeakPointer> _children;
|
||||
|
||||
virtual void parentChanged() const {} // called when parent pointer is updated
|
||||
virtual void parentChanged() {} // called when parent pointer is updated
|
||||
|
||||
private:
|
||||
Transform _transform; // this is to be combined with parent's world-transform to produce this' world-transform.
|
||||
|
|
Loading…
Reference in a new issue