summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.h
diff options
context:
space:
mode:
authorRunitai Linden <davep@lindenlab.com>2022-01-21 10:33:37 -0600
committerRunitai Linden <davep@lindenlab.com>2022-01-21 10:33:37 -0600
commit5b04123aec281de30fb8b6473600f6b1e9d16909 (patch)
tree1ffac17fe885182483ed44fa93db723554761024 /indra/newview/llvoavatar.h
parente7caafba5c4eec21f02a642e37865bc04cd6536e (diff)
parent016b002b0f2faae0d62ce2d07b8e9856a3a1814d (diff)
Merge remote-tracking branch 'remotes/origin/DRTVWR-546' into DRTVWR-539
# Conflicts: # indra/llcommon/lltracerecording.h # indra/newview/llfloaterpreference.cpp
Diffstat (limited to 'indra/newview/llvoavatar.h')
-rw-r--r--indra/newview/llvoavatar.h49
1 files changed, 39 insertions, 10 deletions
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index f83f9d4eaf..282d0f6cdd 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -53,6 +53,7 @@
#include "llviewerstats.h"
#include "llvovolume.h"
#include "llavatarrendernotifier.h"
+#include "llmodel.h"
extern const LLUUID ANIM_AGENT_BODY_NOISE;
extern const LLUUID ANIM_AGENT_BREATHE_ROT;
@@ -77,6 +78,7 @@ class LLViewerJointMesh;
const F32 MAX_AVATAR_LOD_FACTOR = 1.0f;
+extern U32 gFrameCount;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// LLVOAvatar
@@ -87,6 +89,7 @@ class LLVOAvatar :
public LLViewerObject,
public boost::signals2::trackable
{
+ LL_ALIGN_NEW;
LOG_CLASS(LLVOAvatar);
public:
@@ -99,16 +102,6 @@ public:
**/
public:
- void* operator new(size_t size)
- {
- return LLTrace::MemTrackable<LLViewerObject>::aligned_new<16>(size);
- }
-
- void operator delete(void* ptr, size_t size)
- {
- LLTrace::MemTrackable<LLViewerObject>::aligned_delete<16>(ptr, size);
- }
-
LLVOAvatar(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
virtual void markDead();
static void initClass(); // Initialize data that's only init'd once per class.
@@ -209,6 +202,11 @@ public:
virtual LLJoint* getJoint(const std::string &name);
LLJoint* getJoint(S32 num);
+ //if you KNOW joint_num is a valid animated joint index, use getSkeletonJoint for efficiency
+ inline LLJoint* getSkeletonJoint(S32 joint_num) { return mSkeleton[joint_num]; }
+ inline size_t getSkeletonJointCount() const { return mSkeleton.size(); }
+
+
void addAttachmentOverridesForObject(LLViewerObject *vo, std::set<LLUUID>* meshes_seen = NULL, bool recursive = true);
void removeAttachmentOverridesForObject(const LLUUID& mesh_id);
void removeAttachmentOverridesForObject(LLViewerObject *vo);
@@ -381,6 +379,9 @@ protected:
private:
BOOL mFirstFullyVisible;
+ F32 mFirstUseDelaySeconds;
+ LLFrameTimer mFirstSeenTimer;
+
BOOL mFullyLoaded;
BOOL mPreviousFullyLoaded;
BOOL mFullyLoadedInitialized;
@@ -748,6 +749,34 @@ public:
void updateMeshVisibility();
LLViewerTexture* getBakedTexture(const U8 te);
+ // Matrix palette cache entry
+ class alignas(16) MatrixPaletteCache
+ {
+ public:
+ // Last frame this entry was updated
+ U32 mFrame;
+
+ // List of Matrix4a's for this entry
+ LLMeshSkinInfo::matrix_list_t mMatrixPalette;
+
+ // Float array ready to be sent to GL
+ std::vector<F32> mGLMp;
+
+ MatrixPaletteCache() :
+ mFrame(gFrameCount - 1)
+ {
+ }
+ };
+
+ // Accessor for Matrix Palette Cache
+ // Will do a map lookup for the entry associated with the given MeshSkinInfo
+ // Will update said entry if it hasn't been updated yet this frame
+ const MatrixPaletteCache& updateSkinInfoMatrixPalette(const LLMeshSkinInfo* skinInfo);
+
+ // Map of LLMeshSkinInfo::mHash to MatrixPaletteCache
+ typedef std::unordered_map<U64, MatrixPaletteCache> matrix_palette_cache_t;
+ matrix_palette_cache_t mMatrixPaletteCache;
+
protected:
void releaseMeshData();
virtual void restoreMeshData();