mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 22:42:31 +02:00
Merge pull request #12366 from sethalves/fix-children-of-animated-entity-joints
fix -- get children of animated entity joints to follow along, again
This commit is contained in:
commit
63f752e76f
2 changed files with 13 additions and 4 deletions
|
@ -985,6 +985,7 @@ void RenderableModelEntityItem::copyAnimationJointDataToModel() {
|
|||
return;
|
||||
}
|
||||
|
||||
bool changed { false };
|
||||
// relay any inbound joint changes from scripts/animation/network to the model/rig
|
||||
_jointDataLock.withWriteLock([&] {
|
||||
for (int index = 0; index < _localJointData.size(); ++index) {
|
||||
|
@ -992,13 +993,21 @@ void RenderableModelEntityItem::copyAnimationJointDataToModel() {
|
|||
if (jointData.rotationDirty) {
|
||||
model->setJointRotation(index, true, jointData.joint.rotation, 1.0f);
|
||||
jointData.rotationDirty = false;
|
||||
changed = true;
|
||||
}
|
||||
if (jointData.translationDirty) {
|
||||
model->setJointTranslation(index, true, jointData.joint.translation, 1.0f);
|
||||
jointData.translationDirty = false;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (changed) {
|
||||
forEachChild([&](SpatiallyNestablePointer object) {
|
||||
object->locationChanged(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
using namespace render;
|
||||
|
|
|
@ -207,6 +207,10 @@ public:
|
|||
|
||||
void dump(const QString& prefix = "") const;
|
||||
|
||||
virtual void locationChanged(bool tellPhysics = true); // called when a this object's location has changed
|
||||
virtual void dimensionsChanged() { _queryAACubeSet = false; } // called when a this object's dimensions have changed
|
||||
virtual void parentDeleted() { } // called on children of a deleted parent
|
||||
|
||||
protected:
|
||||
const NestableType _nestableType; // EntityItem or an AvatarData
|
||||
QUuid _id;
|
||||
|
@ -218,10 +222,6 @@ protected:
|
|||
mutable ReadWriteLockable _childrenLock;
|
||||
mutable QHash<QUuid, SpatiallyNestableWeakPointer> _children;
|
||||
|
||||
virtual void locationChanged(bool tellPhysics = true); // called when a this object's location has changed
|
||||
virtual void dimensionsChanged() { _queryAACubeSet = false; } // called when a this object's dimensions have changed
|
||||
virtual void parentDeleted() { } // called on children of a deleted parent
|
||||
|
||||
// _queryAACube is used to decide where something lives in the octree
|
||||
mutable AACube _queryAACube;
|
||||
mutable bool _queryAACubeSet { false };
|
||||
|
|
Loading…
Reference in a new issue