diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-10-27 15:10:26 +0100 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-10-27 15:10:26 +0100 |
commit | c025939e42d4c26054ff4a6eeded4b7849c74070 (patch) | |
tree | 08855a8ede4ec12e3a66aa797ad60b98ff608639 /indra | |
parent | 96bc66a55778d25fa36ca42092f0ce3ca57bb3ce (diff) |
MAINT-7857 - shadow fix for animated objects.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/lldrawpoolavatar.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llviewermessage.cpp | 33 | ||||
-rw-r--r-- | indra/newview/llvovolume.cpp | 10 |
3 files changed, 41 insertions, 4 deletions
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index b39b2cd6e5..30560eeb7b 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -468,7 +468,7 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) LLVOAvatar *avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get(); // AXON fix - if (avatarp->isDead() || avatarp->mIsDummy || avatarp->mDrawable.isNull()) + if (avatarp->isDead() || (avatarp->mIsDummy && !avatarp->isControlAvatar()) || avatarp->mDrawable.isNull()) { return; } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 70202e4bc6..fad59aadf4 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5075,6 +5075,18 @@ void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data) } } +// AXON Move to llviewerobject +void recursiveMarkForUpdate(LLViewerObject *vobj, BOOL priority) +{ + for (LLViewerObject::child_list_t::const_iterator iter = vobj->getChildren().begin(); + iter != vobj->getChildren().end(); iter++) + { + LLViewerObject* child = (LLViewerObject*)*iter; + child->markForUpdate(priority); + } + vobj->markForUpdate(priority); +} + void process_object_animation(LLMessageSystem *mesgsys, void **user_data) { LLUUID animation_id; @@ -5113,11 +5125,32 @@ void process_object_animation(LLMessageSystem *mesgsys, void **user_data) S32 num_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_AnimationList); LL_DEBUGS("AXON") << "handle object animation here, num_blocks " << num_blocks << LL_ENDL; +#if 1 if (!avatarp->mPlaying) { avatarp->mPlaying = true; avatarp->updateVolumeGeom(); + recursiveMarkForUpdate(avatarp->mRootVolp,TRUE); } +#else + if (num_blocks > 0 && !avatarp->mPlaying) + { + avatarp->mPlaying = true; + avatarp->updateVolumeGeom(); + // AXON FIXME need to update all objects in the linkset, not just the one where animation is playing + recursiveMarkForUpdate(avatarp->mRootVolp,TRUE); + } + else if (num_blocks == 0 && avatarp->mPlaying) + { + // AXON this will cause meshes to go back to static when no + // animations are signalled. Probably don't want to leave this + // way but helpful for testing. + avatarp->mPlaying = false; + avatarp->updateVolumeGeom(); + // AXON FIXME need to update all objects in the linkset, not just the one where animation is playing + recursiveMarkForUpdate(avatarp->mRootVolp,TRUE); + } +#endif volp->mObjectSignaledAnimations.clear(); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index c9bf609940..d4a601d394 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -5089,8 +5089,12 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) drawablep->clearState(LLDrawable::HAS_ALPHA); - // AXON this includes attached animeshes but leaves out standalone ones. Fix. - bool rigged = vobj->isRiggedMesh() && vobj->isAttachment(); + // Standard rigged mesh attachments: + bool rigged = !vobj->isAnimatedObject() && vobj->isRiggedMesh() && vobj->isAttachment(); + // Animated objects. Have to check for isRiggedMesh() to + // exclude static objects in animated object linksets. + rigged = rigged || (vobj->isAnimatedObject() && vobj->isRiggedMesh() && + vobj->getControlAvatar() && vobj->getControlAvatar()->mPlaying); if (vobj->isAnimatedObject()) { @@ -5149,7 +5153,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) //sum up face verts and indices drawablep->updateFaceSize(i); - if (rigged || (vobj->getControlAvatar() && vobj->getControlAvatar()->mPlaying && vobj->isMesh())) + if (rigged) { if (!facep->isState(LLFace::RIGGED)) { //completely reset vertex buffer |