mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
loading priorities for avatars and attachments
This commit is contained in:
parent
fa3fae09b2
commit
8014f61243
4 changed files with 10 additions and 0 deletions
|
@ -121,6 +121,7 @@ MyAvatar::MyAvatar(QThread* thread) :
|
||||||
_headData = new MyHead(this);
|
_headData = new MyHead(this);
|
||||||
|
|
||||||
_skeletonModel = std::make_shared<MySkeletonModel>(this, nullptr);
|
_skeletonModel = std::make_shared<MySkeletonModel>(this, nullptr);
|
||||||
|
_skeletonModel->setLoadingPriority(MYAVATAR_LOADING_PRIORITY);
|
||||||
connect(_skeletonModel.get(), &Model::setURLFinished, this, &Avatar::setModelURLFinished);
|
connect(_skeletonModel.get(), &Model::setURLFinished, this, &Avatar::setModelURLFinished);
|
||||||
connect(_skeletonModel.get(), &Model::setURLFinished, this, [this](bool success) {
|
connect(_skeletonModel.get(), &Model::setURLFinished, this, [this](bool success) {
|
||||||
if (success) {
|
if (success) {
|
||||||
|
|
|
@ -49,6 +49,9 @@ const float DISPLAYNAME_FADE_FACTOR = pow(0.01f, 1.0f / DISPLAYNAME_FADE_TIME);
|
||||||
const float DISPLAYNAME_ALPHA = 1.0f;
|
const float DISPLAYNAME_ALPHA = 1.0f;
|
||||||
const float DISPLAYNAME_BACKGROUND_ALPHA = 0.4f;
|
const float DISPLAYNAME_BACKGROUND_ALPHA = 0.4f;
|
||||||
const glm::vec3 HAND_TO_PALM_OFFSET(0.0f, 0.12f, 0.08f);
|
const glm::vec3 HAND_TO_PALM_OFFSET(0.0f, 0.12f, 0.08f);
|
||||||
|
const float Avatar::MYAVATAR_LOADING_PRIORITY = (float)M_PI; // Entity priority is computed as atan2(maxDim, distance) which is <= PI / 2
|
||||||
|
const float Avatar::OTHERAVATAR_LOADING_PRIORITY = MYAVATAR_LOADING_PRIORITY - EPSILON;
|
||||||
|
const float Avatar::ATTACHMENT_LOADING_PRIORITY = OTHERAVATAR_LOADING_PRIORITY - EPSILON;
|
||||||
|
|
||||||
namespace render {
|
namespace render {
|
||||||
template <> const ItemKey payloadGetKey(const AvatarSharedPointer& avatar) {
|
template <> const ItemKey payloadGetKey(const AvatarSharedPointer& avatar) {
|
||||||
|
@ -1418,6 +1421,7 @@ void Avatar::setAttachmentData(const QVector<AttachmentData>& attachmentData) {
|
||||||
if (_attachmentModels[i]->getURL() != attachmentData[i].modelURL) {
|
if (_attachmentModels[i]->getURL() != attachmentData[i].modelURL) {
|
||||||
_attachmentModelsTexturesLoaded[i] = false;
|
_attachmentModelsTexturesLoaded[i] = false;
|
||||||
}
|
}
|
||||||
|
_attachmentModels[i]->setLoadingPriority(ATTACHMENT_LOADING_PRIORITY);
|
||||||
_attachmentModels[i]->setURL(attachmentData[i].modelURL);
|
_attachmentModels[i]->setURL(attachmentData[i].modelURL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -540,6 +540,10 @@ protected:
|
||||||
AABox _renderBound;
|
AABox _renderBound;
|
||||||
bool _isMeshVisible{ true };
|
bool _isMeshVisible{ true };
|
||||||
bool _needMeshVisibleSwitch{ true };
|
bool _needMeshVisibleSwitch{ true };
|
||||||
|
|
||||||
|
static const float MYAVATAR_LOADING_PRIORITY;
|
||||||
|
static const float OTHERAVATAR_LOADING_PRIORITY;
|
||||||
|
static const float ATTACHMENT_LOADING_PRIORITY;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_Avatar_h
|
#endif // hifi_Avatar_h
|
||||||
|
|
|
@ -12,6 +12,7 @@ OtherAvatar::OtherAvatar(QThread* thread) : Avatar(thread) {
|
||||||
// give the pointer to our head to inherited _headData variable from AvatarData
|
// give the pointer to our head to inherited _headData variable from AvatarData
|
||||||
_headData = new Head(this);
|
_headData = new Head(this);
|
||||||
_skeletonModel = std::make_shared<SkeletonModel>(this, nullptr);
|
_skeletonModel = std::make_shared<SkeletonModel>(this, nullptr);
|
||||||
|
_skeletonModel->setLoadingPriority(OTHERAVATAR_LOADING_PRIORITY);
|
||||||
connect(_skeletonModel.get(), &Model::setURLFinished, this, &Avatar::setModelURLFinished);
|
connect(_skeletonModel.get(), &Model::setURLFinished, this, &Avatar::setModelURLFinished);
|
||||||
connect(_skeletonModel.get(), &Model::rigReady, this, &Avatar::rigReady);
|
connect(_skeletonModel.get(), &Model::rigReady, this, &Avatar::rigReady);
|
||||||
connect(_skeletonModel.get(), &Model::rigReset, this, &Avatar::rigReset);
|
connect(_skeletonModel.get(), &Model::rigReset, this, &Avatar::rigReset);
|
||||||
|
|
Loading…
Reference in a new issue