mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-08 15:43:17 +02:00
keep removed attachment models around for one extra call to fixupModelsInScene
This commit is contained in:
parent
3145069a10
commit
d95d0f59cb
2 changed files with 4 additions and 0 deletions
|
@ -540,6 +540,7 @@ glm::quat Avatar::computeRotationFromBodyToWorldUp(float proportion) const {
|
|||
}
|
||||
|
||||
void Avatar::fixupModelsInScene() {
|
||||
_attachmentsToDelete.clear();
|
||||
|
||||
// check to see if when we added our models to the scene they were ready, if they were not ready, then
|
||||
// fix them up in the scene
|
||||
|
@ -560,9 +561,11 @@ void Avatar::fixupModelsInScene() {
|
|||
attachmentModel->addToScene(scene, pendingChanges);
|
||||
}
|
||||
}
|
||||
|
||||
for (auto& attachmentModelToRemove : _attachmentsToRemove) {
|
||||
attachmentModelToRemove->removeFromScene(scene, pendingChanges);
|
||||
}
|
||||
_attachmentsToDelete.insert(_attachmentsToDelete.end(), _attachmentsToRemove.begin(), _attachmentsToRemove.end());
|
||||
_attachmentsToRemove.clear();
|
||||
scene->enqueuePendingChanges(pendingChanges);
|
||||
}
|
||||
|
|
|
@ -193,6 +193,7 @@ protected:
|
|||
glm::vec3 _skeletonOffset;
|
||||
std::vector<std::shared_ptr<Model>> _attachmentModels;
|
||||
std::vector<std::shared_ptr<Model>> _attachmentsToRemove;
|
||||
std::vector<std::shared_ptr<Model>> _attachmentsToDelete;
|
||||
|
||||
float _bodyYawDelta; // degrees/sec
|
||||
|
||||
|
|
Loading…
Reference in a new issue