aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llvoavatar.cpp')
-rw-r--r--linden/indra/newview/llvoavatar.cpp142
1 files changed, 66 insertions, 76 deletions
diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp
index 6b5f066..b4357d8 100644
--- a/linden/indra/newview/llvoavatar.cpp
+++ b/linden/indra/newview/llvoavatar.cpp
@@ -888,52 +888,53 @@ LLVOAvatar::LLVOAvatar(
888 if (LLCharacter::sInstances.size() == 1) 888 if (LLCharacter::sInstances.size() == 1)
889 { 889 {
890 LLKeyframeMotion::setVFS(gStaticVFS); 890 LLKeyframeMotion::setVFS(gStaticVFS);
891 addMotion( ANIM_AGENT_BUSY, LLNullMotion::create ); 891 registerMotion( ANIM_AGENT_BUSY, LLNullMotion::create );
892 addMotion( ANIM_AGENT_CROUCH, LLKeyframeStandMotion::create ); 892 registerMotion( ANIM_AGENT_CROUCH, LLKeyframeStandMotion::create );
893 addMotion( ANIM_AGENT_CROUCHWALK, LLKeyframeWalkMotion::create ); 893 registerMotion( ANIM_AGENT_CROUCHWALK, LLKeyframeWalkMotion::create );
894 addMotion( ANIM_AGENT_EXPRESS_AFRAID, LLEmote::create ); 894 registerMotion( ANIM_AGENT_EXPRESS_AFRAID, LLEmote::create );
895 addMotion( ANIM_AGENT_EXPRESS_ANGER, LLEmote::create ); 895 registerMotion( ANIM_AGENT_EXPRESS_ANGER, LLEmote::create );
896 addMotion( ANIM_AGENT_EXPRESS_BORED, LLEmote::create ); 896 registerMotion( ANIM_AGENT_EXPRESS_BORED, LLEmote::create );
897 addMotion( ANIM_AGENT_EXPRESS_CRY, LLEmote::create ); 897 registerMotion( ANIM_AGENT_EXPRESS_CRY, LLEmote::create );
898 addMotion( ANIM_AGENT_EXPRESS_DISDAIN, LLEmote::create ); 898 registerMotion( ANIM_AGENT_EXPRESS_DISDAIN, LLEmote::create );
899 addMotion( ANIM_AGENT_EXPRESS_EMBARRASSED, LLEmote::create ); 899 registerMotion( ANIM_AGENT_EXPRESS_EMBARRASSED, LLEmote::create );
900 addMotion( ANIM_AGENT_EXPRESS_FROWN, LLEmote::create ); 900 registerMotion( ANIM_AGENT_EXPRESS_FROWN, LLEmote::create );
901 addMotion( ANIM_AGENT_EXPRESS_KISS, LLEmote::create ); 901 registerMotion( ANIM_AGENT_EXPRESS_KISS, LLEmote::create );
902 addMotion( ANIM_AGENT_EXPRESS_LAUGH, LLEmote::create ); 902 registerMotion( ANIM_AGENT_EXPRESS_LAUGH, LLEmote::create );
903 addMotion( ANIM_AGENT_EXPRESS_OPEN_MOUTH, LLEmote::create ); 903 registerMotion( ANIM_AGENT_EXPRESS_OPEN_MOUTH, LLEmote::create );
904 addMotion( ANIM_AGENT_EXPRESS_REPULSED, LLEmote::create ); 904 registerMotion( ANIM_AGENT_EXPRESS_REPULSED, LLEmote::create );
905 addMotion( ANIM_AGENT_EXPRESS_SAD, LLEmote::create ); 905 registerMotion( ANIM_AGENT_EXPRESS_SAD, LLEmote::create );
906 addMotion( ANIM_AGENT_EXPRESS_SHRUG, LLEmote::create ); 906 registerMotion( ANIM_AGENT_EXPRESS_SHRUG, LLEmote::create );
907 addMotion( ANIM_AGENT_EXPRESS_SMILE, LLEmote::create ); 907 registerMotion( ANIM_AGENT_EXPRESS_SMILE, LLEmote::create );
908 addMotion( ANIM_AGENT_EXPRESS_SURPRISE, LLEmote::create ); 908 registerMotion( ANIM_AGENT_EXPRESS_SURPRISE, LLEmote::create );
909 addMotion( ANIM_AGENT_EXPRESS_TONGUE_OUT, LLEmote::create ); 909 registerMotion( ANIM_AGENT_EXPRESS_TONGUE_OUT, LLEmote::create );
910 addMotion( ANIM_AGENT_EXPRESS_TOOTHSMILE, LLEmote::create ); 910 registerMotion( ANIM_AGENT_EXPRESS_TOOTHSMILE, LLEmote::create );
911 addMotion( ANIM_AGENT_EXPRESS_WINK, LLEmote::create ); 911 registerMotion( ANIM_AGENT_EXPRESS_WINK, LLEmote::create );
912 addMotion( ANIM_AGENT_EXPRESS_WORRY, LLEmote::create ); 912 registerMotion( ANIM_AGENT_EXPRESS_WORRY, LLEmote::create );
913 addMotion( ANIM_AGENT_RUN, LLKeyframeWalkMotion::create ); 913 registerMotion( ANIM_AGENT_RUN, LLKeyframeWalkMotion::create );
914 addMotion( ANIM_AGENT_STAND, LLKeyframeStandMotion::create ); 914 registerMotion( ANIM_AGENT_STAND, LLKeyframeStandMotion::create );
915 addMotion( ANIM_AGENT_STAND_1, LLKeyframeStandMotion::create ); 915 registerMotion( ANIM_AGENT_STAND_1, LLKeyframeStandMotion::create );
916 addMotion( ANIM_AGENT_STAND_2, LLKeyframeStandMotion::create ); 916 registerMotion( ANIM_AGENT_STAND_2, LLKeyframeStandMotion::create );
917 addMotion( ANIM_AGENT_STAND_3, LLKeyframeStandMotion::create ); 917 registerMotion( ANIM_AGENT_STAND_3, LLKeyframeStandMotion::create );
918 addMotion( ANIM_AGENT_STAND_4, LLKeyframeStandMotion::create ); 918 registerMotion( ANIM_AGENT_STAND_4, LLKeyframeStandMotion::create );
919 addMotion( ANIM_AGENT_STANDUP, LLKeyframeFallMotion::create ); 919 registerMotion( ANIM_AGENT_STANDUP, LLKeyframeFallMotion::create );
920 addMotion( ANIM_AGENT_TURNLEFT, LLKeyframeWalkMotion::create ); 920 registerMotion( ANIM_AGENT_TURNLEFT, LLKeyframeWalkMotion::create );
921 addMotion( ANIM_AGENT_TURNRIGHT, LLKeyframeWalkMotion::create ); 921 registerMotion( ANIM_AGENT_TURNRIGHT, LLKeyframeWalkMotion::create );
922 addMotion( ANIM_AGENT_WALK, LLKeyframeWalkMotion::create ); 922 registerMotion( ANIM_AGENT_WALK, LLKeyframeWalkMotion::create );
923 923
924 // motions without a start/stop bit 924 // motions without a start/stop bit
925 addMotion( ANIM_AGENT_BODY_NOISE, LLBodyNoiseMotion::create ); 925 registerMotion( ANIM_AGENT_BODY_NOISE, LLBodyNoiseMotion::create );
926 addMotion( ANIM_AGENT_BREATHE_ROT, LLBreatheMotionRot::create ); 926 registerMotion( ANIM_AGENT_BREATHE_ROT, LLBreatheMotionRot::create );
927 addMotion( ANIM_AGENT_EDITING, LLEditingMotion::create ); 927 registerMotion( ANIM_AGENT_EDITING, LLEditingMotion::create );
928 addMotion( ANIM_AGENT_EYE, LLEyeMotion::create ); 928 registerMotion( ANIM_AGENT_EYE, LLEyeMotion::create );
929 addMotion( ANIM_AGENT_FEMALE_WALK, LLKeyframeWalkMotion::create ); 929 registerMotion( ANIM_AGENT_FEMALE_WALK, LLKeyframeWalkMotion::create );
930 addMotion( ANIM_AGENT_FLY_ADJUST, LLFlyAdjustMotion::create ); 930 registerMotion( ANIM_AGENT_FLY_ADJUST, LLFlyAdjustMotion::create );
931 addMotion( ANIM_AGENT_HAND_MOTION, LLHandMotion::create ); 931 registerMotion( ANIM_AGENT_HAND_MOTION, LLHandMotion::create );
932 addMotion( ANIM_AGENT_HEAD_ROT, LLHeadRotMotion::create ); 932 registerMotion( ANIM_AGENT_HEAD_ROT, LLHeadRotMotion::create );
933 addMotion( ANIM_AGENT_PELVIS_FIX, LLPelvisFixMotion::create ); 933 registerMotion( ANIM_AGENT_PELVIS_FIX, LLPelvisFixMotion::create );
934 addMotion( ANIM_AGENT_SIT_FEMALE, LLKeyframeMotion::create ); 934 registerMotion( ANIM_AGENT_SIT_FEMALE, LLKeyframeMotion::create );
935 addMotion( ANIM_AGENT_TARGET, LLTargetingMotion::create ); 935 registerMotion( ANIM_AGENT_TARGET, LLTargetingMotion::create );
936 addMotion( ANIM_AGENT_WALK_ADJUST, LLWalkAdjustMotion::create ); 936 registerMotion( ANIM_AGENT_WALK_ADJUST, LLWalkAdjustMotion::create );
937
937 } 938 }
938 939
939 if (gNoRender) 940 if (gNoRender)
@@ -3329,7 +3330,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
3329 // the rest should only be done occasionally for far away avatars 3330 // the rest should only be done occasionally for far away avatars
3330 //-------------------------------------------------------------------- 3331 //--------------------------------------------------------------------
3331 3332
3332 if (!mIsSelf && sUseImpostors && !mNeedsAnimUpdate && !sFreezeCounter) 3333 if (!mIsSelf && !mIsDummy && sUseImpostors && !mNeedsAnimUpdate && !sFreezeCounter)
3333 { 3334 {
3334 F32 impostor_area = 256.f*512.f*(8.125f - LLVOAvatar::sLODFactor*8.f); 3335 F32 impostor_area = 256.f*512.f*(8.125f - LLVOAvatar::sLODFactor*8.f);
3335 if (LLMuteList::getInstance()->isMuted(getID())) 3336 if (LLMuteList::getInstance()->isMuted(getID()))
@@ -3350,22 +3351,13 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
3350 3351
3351 if (!visible) 3352 if (!visible)
3352 { 3353 {
3353 if (!mMotionController.isPaused()) 3354 updateMotions(LLCharacter::HIDDEN_UPDATE);
3354 {
3355 mMotionController.pause();
3356 mMotionController.updateMotion();
3357 mMotionController.unpause();
3358 }
3359 else
3360 {
3361 mMotionController.updateMotion();
3362 }
3363 return FALSE; 3355 return FALSE;
3364 } 3356 }
3365 } 3357 }
3366 3358
3367 // change animation time quanta based on avatar render load 3359 // change animation time quanta based on avatar render load
3368 if (!mIsSelf) 3360 if (!mIsSelf && !mIsDummy)
3369 { 3361 {
3370 F32 time_quantum = clamp_rescale((F32)sInstances.size(), 10.f, 35.f, 0.f, 0.25f); 3362 F32 time_quantum = clamp_rescale((F32)sInstances.size(), 10.f, 35.f, 0.f, 0.25f);
3371 F32 pixel_area_scale = clamp_rescale(mPixelArea, 100, 5000, 1.f, 0.f); 3363 F32 pixel_area_scale = clamp_rescale(mPixelArea, 100, 5000, 1.f, 0.f);
@@ -3639,10 +3631,10 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
3639 mSpeed = speed; 3631 mSpeed = speed;
3640 3632
3641 // update animations 3633 // update animations
3642 { 3634 if (mSpecialRenderMode == 1) // Animation Preview
3643 LLFastTimer t(LLFastTimer::FTM_UPDATE_ANIMATION); 3635 updateMotions(LLCharacter::FORCE_UPDATE);
3644 updateMotion(); 3636 else
3645 } 3637 updateMotions(LLCharacter::NORMAL_UPDATE);
3646 3638
3647 // update head position 3639 // update head position
3648 updateHeadOffset(); 3640 updateHeadOffset();
@@ -3818,9 +3810,6 @@ void LLVOAvatar::updateVisibility()
3818 } 3810 }
3819 else 3811 else
3820 { 3812 {
3821 // calculate avatar distance wrt head
3822 mDrawable->updateDistance(*LLViewerCamera::getInstance());
3823
3824 if (!mDrawable->getSpatialGroup() || mDrawable->getSpatialGroup()->isVisible()) 3813 if (!mDrawable->getSpatialGroup() || mDrawable->getSpatialGroup()->isVisible())
3825 { 3814 {
3826 visible = TRUE; 3815 visible = TRUE;
@@ -3837,8 +3826,7 @@ void LLVOAvatar::updateVisibility()
3837 visible = FALSE; 3826 visible = FALSE;
3838 } 3827 }
3839 } 3828 }
3840 else 3829 else if( !mFirstAppearanceMessageReceived )
3841 if( !mFirstAppearanceMessageReceived )
3842 { 3830 {
3843 visible = FALSE; 3831 visible = FALSE;
3844 } 3832 }
@@ -3984,19 +3972,19 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass)
3984 if (mNeedsSkin) 3972 if (mNeedsSkin)
3985 { 3973 {
3986 //generate animated mesh 3974 //generate animated mesh
3987 mLowerBodyLOD.updateGeometry(); 3975 mLowerBodyLOD.updateJointGeometry();
3988 mUpperBodyLOD.updateGeometry(); 3976 mUpperBodyLOD.updateJointGeometry();
3989 3977
3990 if( isWearingWearableType( WT_SKIRT ) ) 3978 if( isWearingWearableType( WT_SKIRT ) )
3991 { 3979 {
3992 mSkirtLOD.updateGeometry(); 3980 mSkirtLOD.updateJointGeometry();
3993 } 3981 }
3994 3982
3995 if (!mIsSelf || gAgent.needsRenderHead()) 3983 if (!mIsSelf || gAgent.needsRenderHead())
3996 { 3984 {
3997 mEyeLashLOD.updateGeometry(); 3985 mEyeLashLOD.updateJointGeometry();
3998 mHeadLOD.updateGeometry(); 3986 mHeadLOD.updateJointGeometry();
3999 mHairLOD.updateGeometry(); 3987 mHairLOD.updateJointGeometry();
4000 } 3988 }
4001 mNeedsSkin = FALSE; 3989 mNeedsSkin = FALSE;
4002 3990
@@ -5756,6 +5744,7 @@ void LLVOAvatar::setPixelAreaAndAngle(LLAgent &agent)
5756//----------------------------------------------------------------------------- 5744//-----------------------------------------------------------------------------
5757BOOL LLVOAvatar::updateJointLODs() 5745BOOL LLVOAvatar::updateJointLODs()
5758{ 5746{
5747 const F32 MAX_PIXEL_AREA = 100000000.f;
5759 F32 lod_factor = (sLODFactor * AVATAR_LOD_TWEAK_RANGE + (1.f - AVATAR_LOD_TWEAK_RANGE)); 5748 F32 lod_factor = (sLODFactor * AVATAR_LOD_TWEAK_RANGE + (1.f - AVATAR_LOD_TWEAK_RANGE));
5760 F32 avatar_num_min_factor = clamp_rescale(sLODFactor, 0.f, 1.f, 0.25f, 0.6f); 5749 F32 avatar_num_min_factor = clamp_rescale(sLODFactor, 0.f, 1.f, 0.25f, 0.6f);
5761 F32 avatar_num_factor = clamp_rescale((F32)sNumVisibleAvatars, 8, 25, 1.f, avatar_num_min_factor); 5750 F32 avatar_num_factor = clamp_rescale((F32)sNumVisibleAvatars, 8, 25, 1.f, avatar_num_min_factor);
@@ -5766,7 +5755,7 @@ BOOL LLVOAvatar::updateJointLODs()
5766 { 5755 {
5767 if(gAgent.cameraCustomizeAvatar() || gAgent.cameraMouselook()) 5756 if(gAgent.cameraCustomizeAvatar() || gAgent.cameraMouselook())
5768 { 5757 {
5769 mAdjustedPixelArea = 1000000; 5758 mAdjustedPixelArea = MAX_PIXEL_AREA;
5770 } 5759 }
5771 else 5760 else
5772 { 5761 {
@@ -5775,7 +5764,7 @@ BOOL LLVOAvatar::updateJointLODs()
5775 } 5764 }
5776 else if (mIsDummy) 5765 else if (mIsDummy)
5777 { 5766 {
5778 mAdjustedPixelArea = 1000000; 5767 mAdjustedPixelArea = MAX_PIXEL_AREA;
5779 } 5768 }
5780 else 5769 else
5781 { 5770 {
@@ -6729,7 +6718,7 @@ void LLVOAvatar::dumpTotalLocalTextureByteCount()
6729 6718
6730BOOL LLVOAvatar::isVisible() 6719BOOL LLVOAvatar::isVisible()
6731{ 6720{
6732 return mDrawable.notNull() && mDrawable->isVisible(); 6721 return mDrawable.notNull() && (mDrawable->isVisible() || mIsDummy);
6733} 6722}
6734 6723
6735 6724
@@ -9691,7 +9680,8 @@ BOOL LLVOAvatar::updateLOD()
9691 mDrawable->clearState(LLDrawable::REBUILD_GEOMETRY); 9680 mDrawable->clearState(LLDrawable::REBUILD_GEOMETRY);
9692 } 9681 }
9693 9682
9694 9683 updateVisibility();
9684
9695 return res; 9685 return res;
9696} 9686}
9697 9687