MAINT-7857 - shadow fix for animated objects.
parent
96bc66a557
commit
c025939e42
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue