mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
add invalidateJointIndicesCache method
This commit is contained in:
parent
ef4a04b9cf
commit
57ba2c5cd6
2 changed files with 8 additions and 4 deletions
|
@ -1020,6 +1020,11 @@ void Avatar::cacheJoints() const {
|
|||
}
|
||||
}
|
||||
|
||||
void Avatar::invalidateJointIndicesCache() const {
|
||||
QWriteLocker writeLock(&_jointIndicesCacheLock);
|
||||
_jointsCached = false;
|
||||
}
|
||||
|
||||
int Avatar::getJointIndex(const QString& name) const {
|
||||
int result = getFauxJointIndex(name);
|
||||
if (result != -1) {
|
||||
|
@ -1090,10 +1095,8 @@ void Avatar::setSkeletonModelURL(const QUrl& skeletonModelURL) {
|
|||
}
|
||||
|
||||
void Avatar::setModelURLFinished(bool success) {
|
||||
{
|
||||
QWriteLocker writeLock(&_jointIndicesCacheLock);
|
||||
_jointsCached = false;
|
||||
}
|
||||
invalidateJointIndicesCache();
|
||||
|
||||
if (!success && _skeletonModelURL != AvatarData::defaultFullAvatarModelUrl()) {
|
||||
const int MAX_SKELETON_DOWNLOAD_ATTEMPTS = 4; // NOTE: we don't want to be as generous as ResourceCache is, we only want 4 attempts
|
||||
if (_skeletonModel->getResourceDownloadAttemptsRemaining() <= 0 ||
|
||||
|
|
|
@ -269,6 +269,7 @@ protected:
|
|||
SkeletonModelPointer _skeletonModel;
|
||||
|
||||
void cacheJoints() const;
|
||||
void invalidateJointIndicesCache() const;
|
||||
mutable QHash<QString, int> _jointIndicesCache;
|
||||
mutable QReadWriteLock _jointIndicesCacheLock;
|
||||
mutable bool _jointsCached { false };
|
||||
|
|
Loading…
Reference in a new issue