mirror of
https://github.com/lubosz/overte.git
synced 2025-04-19 17:03:43 +02:00
Fix cauterization when reparent entity to a different joint
This commit is contained in:
parent
4dd6ba1d18
commit
be4b929301
4 changed files with 10 additions and 0 deletions
|
@ -531,6 +531,10 @@ void MyAvatar::forgetChild(SpatiallyNestablePointer newChild) const {
|
|||
SpatiallyNestable::forgetChild(newChild);
|
||||
}
|
||||
|
||||
void MyAvatar::recalculateChildCauterization() const {
|
||||
_cauterizationNeedsUpdate = true;
|
||||
}
|
||||
|
||||
void MyAvatar::updateChildCauterization(SpatiallyNestablePointer object, bool cauterize) {
|
||||
if (object->getNestableType() == NestableType::Entity) {
|
||||
EntityItemPointer entity = std::static_pointer_cast<EntityItem>(object);
|
||||
|
|
|
@ -1374,6 +1374,7 @@ private slots:
|
|||
protected:
|
||||
virtual void beParentOfChild(SpatiallyNestablePointer newChild) const override;
|
||||
virtual void forgetChild(SpatiallyNestablePointer newChild) const override;
|
||||
virtual void recalculateChildCauterization() const override;
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -165,6 +165,10 @@ void SpatiallyNestable::forgetChild(SpatiallyNestablePointer newChild) const {
|
|||
|
||||
void SpatiallyNestable::setParentJointIndex(quint16 parentJointIndex) {
|
||||
_parentJointIndex = parentJointIndex;
|
||||
auto parent = _parent.lock();
|
||||
if (parent) {
|
||||
parent->recalculateChildCauterization();
|
||||
}
|
||||
}
|
||||
|
||||
glm::vec3 SpatiallyNestable::worldToLocal(const glm::vec3& position,
|
||||
|
|
|
@ -218,6 +218,7 @@ protected:
|
|||
|
||||
virtual void beParentOfChild(SpatiallyNestablePointer newChild) const;
|
||||
virtual void forgetChild(SpatiallyNestablePointer newChild) const;
|
||||
virtual void recalculateChildCauterization() const { }
|
||||
|
||||
mutable ReadWriteLockable _childrenLock;
|
||||
mutable QHash<QUuid, SpatiallyNestableWeakPointer> _children;
|
||||
|
|
Loading…
Reference in a new issue