Update billboard when attachments change.

This commit is contained in:
Andrzej Kapolka 2014-05-08 16:23:15 -07:00
parent c02b708ee5
commit acab09b89a
2 changed files with 15 additions and 1 deletions

View file

@ -584,6 +584,14 @@ void MyAvatar::setSkeletonModelURL(const QUrl& skeletonModelURL) {
_billboardValid = false;
}
void MyAvatar::setAttachmentData(const QVector<AttachmentData>& attachmentData) {
Avatar::setAttachmentData(attachmentData);
if (QThread::currentThread() != thread()) {
return;
}
_billboardValid = false;
}
void MyAvatar::renderBody(RenderMode renderMode, float glowLevel) {
if (!(_skeletonModel.isRenderable() && getHead()->getFaceModel().isRenderable())) {
return; // wait until both models are loaded
@ -1247,6 +1255,11 @@ void MyAvatar::maybeUpdateBillboard() {
if (_billboardValid || !(_skeletonModel.isLoadedWithTextures() && getHead()->getFaceModel().isLoadedWithTextures())) {
return;
}
foreach (Model* model, _attachmentModels) {
if (!model->isLoadedWithTextures()) {
return;
}
}
QImage image = Application::getInstance()->renderAvatarBillboard();
_billboard.clear();
QBuffer buffer(&_billboard);

View file

@ -86,7 +86,8 @@ public:
virtual void clearJointData(int index);
virtual void setFaceModelURL(const QUrl& faceModelURL);
virtual void setSkeletonModelURL(const QUrl& skeletonModelURL);
virtual void setAttachmentData(const QVector<AttachmentData>& attachmentData);
virtual void setCollisionGroups(quint32 collisionGroups);
void setMotionBehaviorsByScript(quint32 flags);