diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2021-02-17 21:21:21 +0200 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2021-02-17 21:21:21 +0200 |
commit | 976ece38071e861517323c74b5c2c67a6f005ad0 (patch) | |
tree | 8534a13f8369e762fa663fcd2ad2927c809f1604 /indra/newview/llvoavatar.h | |
parent | f06ebd054bfbcf7e3b4c8deb097cbb5064b85366 (diff) | |
parent | 00c47d079f7e958e473ed4083a7f7691fa02dcd5 (diff) |
Merge branch 'master' into DRTVWR-516-maint
Diffstat (limited to 'indra/newview/llvoavatar.h')
-rw-r--r-- | indra/newview/llvoavatar.h | 64 |
1 files changed, 53 insertions, 11 deletions
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 79f31ba5b5..74ef589ca4 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -91,6 +91,7 @@ class LLVOAvatar : public: friend class LLVOAvatarSelf; + friend class LLAvatarCheckImpostorMode; /******************************************************************************** ** ** @@ -131,6 +132,7 @@ protected: public: /*virtual*/ void updateGL(); /*virtual*/ LLVOAvatar* asAvatar(); + virtual U32 processUpdateMessage(LLMessageSystem *mesgsys, void **user_data, U32 block_num, @@ -252,6 +254,11 @@ public: virtual bool isControlAvatar() const { return mIsControlAvatar; } // True if this avatar is a control av (no associated user) virtual bool isUIAvatar() const { return mIsUIAvatar; } // True if this avatar is a supplemental av used in some UI views (no associated user) + // If this is an attachment, return the avatar it is attached to. Otherwise NULL. + virtual const LLVOAvatar *getAttachedAvatar() const { return NULL; } + virtual LLVOAvatar *getAttachedAvatar() { return NULL; } + + private: //aligned members LL_ALIGN_16(LLVector4a mImpostorExtents[2]); @@ -262,7 +269,8 @@ public: void updateAppearanceMessageDebugText(); void updateAnimationDebugText(); virtual void updateDebugText(); - virtual BOOL updateCharacter(LLAgent &agent); + virtual bool computeNeedsUpdate(); + virtual bool updateCharacter(LLAgent &agent); void updateFootstepSounds(); void computeUpdatePeriod(); void updateOrientation(LLAgent &agent, F32 speed, F32 delta_time); @@ -314,12 +322,12 @@ public: public: static S32 sRenderName; static BOOL sRenderGroupTitles; - static const U32 IMPOSTORS_OFF; /* Must equal the maximum allowed the RenderAvatarMaxNonImpostors - * slider in panel_preferences_graphics1.xml */ - static U32 sMaxNonImpostors; //(affected by control "RenderAvatarMaxNonImpostors") - static F32 sRenderDistance; //distance at which avatars will render. + static const U32 NON_IMPOSTORS_MAX_SLIDER; /* Must equal the maximum allowed the RenderAvatarMaxNonImpostors + * slider in panel_preferences_graphics1.xml */ + static U32 sMaxNonImpostors; // affected by control "RenderAvatarMaxNonImpostors" + static bool sLimitNonImpostors; // use impostors for far away avatars + static F32 sRenderDistance; // distance at which avatars will render. static BOOL sShowAnimationDebug; // show animation debug info - static bool sUseImpostors; //use impostors for far away avatars static BOOL sShowFootPlane; // show foot collision plane reported by server static BOOL sShowCollisionVolumes; // show skeletal collision volumes static BOOL sVisibleInFirstPerson; @@ -407,6 +415,7 @@ public: void initAttachmentPoints(bool ignore_hud_joints = false); /*virtual*/ void buildCharacter(); void resetVisualParams(); + void applyDefaultParams(); void resetSkeleton(bool reset_animations); LLVector3 mCurRootToHeadOffset; @@ -427,9 +436,12 @@ public: public: U32 renderImpostor(LLColor4U color = LLColor4U(255,255,255,255), S32 diffuse_channel = 0); bool isVisuallyMuted(); - bool isInMuteList(); + bool isInMuteList() const; void forceUpdateVisualMuteSettings(); + // Visual Mute Setting is an input. Does not necessarily determine + // what the avatar looks like, because it interacts with other + // settings like muting, complexity threshold. Should be private or protected. enum VisualMuteSettings { AV_RENDER_NORMALLY = 0, @@ -437,8 +449,36 @@ public: AV_ALWAYS_RENDER = 2 }; void setVisualMuteSettings(VisualMuteSettings set); + +protected: + // If you think you need to access this outside LLVOAvatar, you probably want getOverallAppearance() VisualMuteSettings getVisualMuteSettings() { return mVisuallyMuteSetting; }; +public: + + // Overall Appearance is an output. Depending on whether the + // avatar is blocked/muted, whether it exceeds the complexity + // threshold, etc, avatar will want to be displayed in one of + // these ways. Rendering code that wants to know how to display an + // avatar should be looking at this value, NOT the visual mute + // settings + enum AvatarOverallAppearance + { + AOA_NORMAL, + AOA_JELLYDOLL, + AOA_INVISIBLE + }; + + AvatarOverallAppearance getOverallAppearance() const; + void setOverallAppearanceNormal(); + void setOverallAppearanceJellyDoll(); + void setOverallAppearanceInvisible(); + + void updateOverallAppearance(); + void updateOverallAppearanceAnimations(); + + std::set<LLUUID> mJellyAnims; + U32 renderRigid(); U32 renderSkinned(); F32 getLastSkinTime() { return mLastSkinTime; } @@ -451,7 +491,8 @@ public: static void restoreGL(); S32 mSpecialRenderMode; // special lighting - private: +private: + AvatarOverallAppearance mOverallAppearance; F32 mAttachmentSurfaceArea; //estimated surface area of attachments U32 mAttachmentVisibleTriangleCount; F32 mAttachmentEstTriangleCount; @@ -468,8 +509,8 @@ public: mutable bool mVisualComplexityStale; U32 mReportedVisualComplexity; // from other viewers through the simulator - bool mCachedInMuteList; - F64 mCachedMuteListUpdateTime; + mutable bool mCachedInMuteList; + mutable F64 mCachedMuteListUpdateTime; VisualMuteSettings mVisuallyMuteSetting; // Always or never visually mute this AV @@ -520,7 +561,7 @@ private: //-------------------------------------------------------------------- public: virtual BOOL isImpostor(); - BOOL shouldImpostor(const U32 rank_factor = 1) const; + BOOL shouldImpostor(const F32 rank_factor = 1.0); BOOL needsImpostorUpdate() const; const LLVector3& getImpostorOffset() const; const LLVector2& getImpostorDim() const; @@ -531,6 +572,7 @@ public: static void updateImpostors(); LLRenderTarget mImpostor; BOOL mNeedsImpostorUpdate; + S32 mLastImpostorUpdateReason; F32SecondsImplicit mLastImpostorUpdateFrameTime; const LLVector3* getLastAnimExtents() const { return mLastAnimExtents; } void setNeedsExtentUpdate(bool val) { mNeedsExtentUpdate = val; } |