From c355fb98d3f4040196b7b8586dc9328fccb906d2 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Mon, 3 Sep 2012 06:12:50 +0000 Subject: Extracted texture baking system into llappearance library. --- indra/llappearance/llavatarappearance.h | 128 ++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 indra/llappearance/llavatarappearance.h (limited to 'indra/llappearance/llavatarappearance.h') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h new file mode 100644 index 0000000000..cb2ae7aeef --- /dev/null +++ b/indra/llappearance/llavatarappearance.h @@ -0,0 +1,128 @@ +/** + * @file llavatarappearance.h + * @brief Declaration of LLAvatarAppearance class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_AVATAR_APPEARANCE_H +#define LL_AVATAR_APPEARANCE_H + +#include "llcharacter.h" +#include "llframetimer.h" +#include "llvoavatardefines.h" + +class LLTexGlobalColor; +class LLTexLayerSet; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// LLAvatarAppearance +// +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLAvatarAppearance : public LLCharacter +{ + LOG_CLASS(LLAvatarAppearance); + +public: + LLAvatarAppearance(); + + //-------------------------------------------------------------------- + // Clothing colors (convenience functions to access visual parameters) + //-------------------------------------------------------------------- +public: + void setClothesColor(LLVOAvatarDefines::ETextureIndex te, const LLColor4& new_color, BOOL upload_bake); + LLColor4 getClothesColor(LLVOAvatarDefines::ETextureIndex te); + static BOOL teToColorParams(LLVOAvatarDefines::ETextureIndex te, U32 *param_name); + + //-------------------------------------------------------------------- + // Global colors + //-------------------------------------------------------------------- +public: + LLColor4 getGlobalColor(const std::string& color_name ) const; + virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake) = 0; +protected: + LLTexGlobalColor* mTexSkinColor; + LLTexGlobalColor* mTexHairColor; + LLTexGlobalColor* mTexEyeColor; + + //-------------------------------------------------------------------- + // Morph masks + //-------------------------------------------------------------------- +public: + virtual void applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLVOAvatarDefines::EBakedTextureIndex index = LLVOAvatarDefines::BAKED_NUM_INDICES) = 0; + + //-------------------------------------------------------------------- + // Composites + //-------------------------------------------------------------------- +public: + virtual void invalidateComposite(LLTexLayerSet* layerset, BOOL upload_result) = 0; + +/******************************************************************************** + ** ** + ** MESHES + **/ + virtual void dirtyMesh() = 0; // Dirty the avatar mesh + virtual void dirtyMesh(S32 priority) = 0; // Dirty the avatar mesh, with priority + +/******************************************************************************** + ** ** + ** RENDERING + **/ + BOOL mIsDummy; // for special views + +/******************************************************************************** + ** ** + ** STATE + **/ +public: + virtual bool isSelf() const { return false; } // True if this avatar is for this viewer's agent + virtual BOOL isUsingBakedTextures() const = 0; + +/******************************************************************************** + ** ** + ** WEARABLES + **/ +public: + virtual U32 getWearableCount(const LLWearableType::EType type) const = 0; + virtual U32 getWearableCount(const U32 tex_index) const = 0; + + virtual LLWearable* getWearable(const LLWearableType::EType type, U32 index /*= 0*/) = 0; + virtual const LLWearable* getWearable(const LLWearableType::EType type, U32 index /*= 0*/) const = 0; + + virtual BOOL isWearingWearableType(LLWearableType::EType type ) const = 0; + + //-------------------------------------------------------------------- + // Avatar Rez Metrics + //-------------------------------------------------------------------- +public: + F32 debugGetExistenceTimeElapsedF32() const { return mDebugExistenceTimer.getElapsedTimeF32(); } + +protected: + LLFrameTimer mDebugExistenceTimer; // Debugging for how long the avatar has been in memory. + +public: + static LLColor4 getDummyColor(); + virtual void updateMeshTextures() = 0; +}; + +#endif // LL_AVATAR_APPEARANCE_H -- cgit v1.2.3 From 0c7623f628cbba999860379a2f5c302d94c1d287 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Mon, 3 Sep 2012 08:37:58 +0000 Subject: Cleanup of llappearance refactor file definition order for easier diff'ing --- indra/llappearance/llavatarappearance.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'indra/llappearance/llavatarappearance.h') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index cb2ae7aeef..1b0e0ad270 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -111,15 +111,6 @@ public: virtual BOOL isWearingWearableType(LLWearableType::EType type ) const = 0; - //-------------------------------------------------------------------- - // Avatar Rez Metrics - //-------------------------------------------------------------------- -public: - F32 debugGetExistenceTimeElapsedF32() const { return mDebugExistenceTimer.getElapsedTimeF32(); } - -protected: - LLFrameTimer mDebugExistenceTimer; // Debugging for how long the avatar has been in memory. - public: static LLColor4 getDummyColor(); virtual void updateMeshTextures() = 0; -- cgit v1.2.3 From 21c364c4d455cc05ec176032e8c090be0cc4ed50 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Mon, 3 Sep 2012 09:10:24 +0000 Subject: Renamed LLVOAvatarDefines to LLAvatarAppearanceDefines --- indra/llappearance/llavatarappearance.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/llappearance/llavatarappearance.h') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 1b0e0ad270..0ab3960e64 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -29,7 +29,7 @@ #include "llcharacter.h" #include "llframetimer.h" -#include "llvoavatardefines.h" +#include "llavatarappearancedefines.h" class LLTexGlobalColor; class LLTexLayerSet; @@ -50,9 +50,9 @@ public: // Clothing colors (convenience functions to access visual parameters) //-------------------------------------------------------------------- public: - void setClothesColor(LLVOAvatarDefines::ETextureIndex te, const LLColor4& new_color, BOOL upload_bake); - LLColor4 getClothesColor(LLVOAvatarDefines::ETextureIndex te); - static BOOL teToColorParams(LLVOAvatarDefines::ETextureIndex te, U32 *param_name); + void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color, BOOL upload_bake); + LLColor4 getClothesColor(LLAvatarAppearanceDefines::ETextureIndex te); + static BOOL teToColorParams(LLAvatarAppearanceDefines::ETextureIndex te, U32 *param_name); //-------------------------------------------------------------------- // Global colors @@ -69,7 +69,7 @@ protected: // Morph masks //-------------------------------------------------------------------- public: - virtual void applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLVOAvatarDefines::EBakedTextureIndex index = LLVOAvatarDefines::BAKED_NUM_INDICES) = 0; + virtual void applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLAvatarAppearanceDefines::EBakedTextureIndex index = LLAvatarAppearanceDefines::BAKED_NUM_INDICES) = 0; //-------------------------------------------------------------------- // Composites -- cgit v1.2.3 From 7b4385420edf3f431ddc4a7042bbc9623ffedd34 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Tue, 4 Sep 2012 04:24:47 +0000 Subject: More clean-up to closer match original file order. For llavatarappearance diffs --- indra/llappearance/llavatarappearance.h | 95 +++++++++++++++++++++++---------- 1 file changed, 67 insertions(+), 28 deletions(-) (limited to 'indra/llappearance/llavatarappearance.h') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 0ab3960e64..e882868e91 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -31,8 +31,8 @@ #include "llframetimer.h" #include "llavatarappearancedefines.h" -class LLTexGlobalColor; class LLTexLayerSet; +class LLTexGlobalColor; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // LLAvatarAppearance @@ -43,27 +43,36 @@ class LLAvatarAppearance : public LLCharacter { LOG_CLASS(LLAvatarAppearance); +/******************************************************************************** + ** ** + ** INITIALIZATION + **/ + public: LLAvatarAppearance(); - //-------------------------------------------------------------------- - // Clothing colors (convenience functions to access visual parameters) - //-------------------------------------------------------------------- -public: - void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color, BOOL upload_bake); - LLColor4 getClothesColor(LLAvatarAppearanceDefines::ETextureIndex te); - static BOOL teToColorParams(LLAvatarAppearanceDefines::ETextureIndex te, U32 *param_name); +/** Initialization + ** ** + *******************************************************************************/ - //-------------------------------------------------------------------- - // Global colors - //-------------------------------------------------------------------- +/******************************************************************************** + ** ** + ** STATE + **/ public: - LLColor4 getGlobalColor(const std::string& color_name ) const; - virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake) = 0; -protected: - LLTexGlobalColor* mTexSkinColor; - LLTexGlobalColor* mTexHairColor; - LLTexGlobalColor* mTexEyeColor; + virtual bool isSelf() const { return false; } // True if this avatar is for this viewer's agent + virtual BOOL isUsingBakedTextures() const = 0; + +/** State + ** ** + *******************************************************************************/ + + +/******************************************************************************** + ** ** + ** RENDERING + **/ + BOOL mIsDummy; // for special views //-------------------------------------------------------------------- // Morph masks @@ -71,6 +80,10 @@ protected: public: virtual void applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLAvatarAppearanceDefines::EBakedTextureIndex index = LLAvatarAppearanceDefines::BAKED_NUM_INDICES) = 0; +/** Rendering + ** ** + *******************************************************************************/ + //-------------------------------------------------------------------- // Composites //-------------------------------------------------------------------- @@ -81,39 +94,65 @@ public: ** ** ** MESHES **/ + +public: + virtual void updateMeshTextures() = 0; virtual void dirtyMesh() = 0; // Dirty the avatar mesh +protected: virtual void dirtyMesh(S32 priority) = 0; // Dirty the avatar mesh, with priority -/******************************************************************************** +/** Meshes ** ** - ** RENDERING - **/ - BOOL mIsDummy; // for special views + *******************************************************************************/ /******************************************************************************** ** ** - ** STATE + ** APPEARANCE **/ + + //-------------------------------------------------------------------- + // Clothing colors (convenience functions to access visual parameters) + //-------------------------------------------------------------------- public: - virtual bool isSelf() const { return false; } // True if this avatar is for this viewer's agent - virtual BOOL isUsingBakedTextures() const = 0; + void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color, BOOL upload_bake); + LLColor4 getClothesColor(LLAvatarAppearanceDefines::ETextureIndex te); + static BOOL teToColorParams(LLAvatarAppearanceDefines::ETextureIndex te, U32 *param_name); + + //-------------------------------------------------------------------- + // Global colors + //-------------------------------------------------------------------- +public: + LLColor4 getGlobalColor(const std::string& color_name ) const; + virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake) = 0; +protected: + LLTexGlobalColor* mTexSkinColor; + LLTexGlobalColor* mTexHairColor; + LLTexGlobalColor* mTexEyeColor; + + //-------------------------------------------------------------------- + // Visibility + //-------------------------------------------------------------------- +public: + static LLColor4 getDummyColor(); +/** Appearance + ** ** + *******************************************************************************/ /******************************************************************************** ** ** ** WEARABLES **/ + public: + virtual BOOL isWearingWearableType(LLWearableType::EType type ) const = 0; + virtual U32 getWearableCount(const LLWearableType::EType type) const = 0; virtual U32 getWearableCount(const U32 tex_index) const = 0; virtual LLWearable* getWearable(const LLWearableType::EType type, U32 index /*= 0*/) = 0; virtual const LLWearable* getWearable(const LLWearableType::EType type, U32 index /*= 0*/) const = 0; - virtual BOOL isWearingWearableType(LLWearableType::EType type ) const = 0; -public: - static LLColor4 getDummyColor(); - virtual void updateMeshTextures() = 0; }; #endif // LL_AVATAR_APPEARANCE_H -- cgit v1.2.3 From 41301004e13bec1c74f444f42372a3a6609cb305 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Tue, 4 Sep 2012 22:49:26 +0000 Subject: Cleanup actions from code review of llappearance with nyx --- indra/llappearance/llavatarappearance.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llappearance/llavatarappearance.h') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index e882868e91..0e746b3b9d 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -28,7 +28,7 @@ #define LL_AVATAR_APPEARANCE_H #include "llcharacter.h" -#include "llframetimer.h" +//#include "llframetimer.h" #include "llavatarappearancedefines.h" class LLTexLayerSet; @@ -50,6 +50,7 @@ class LLAvatarAppearance : public LLCharacter public: LLAvatarAppearance(); + virtual ~LLAvatarAppearance(); /** Initialization ** ** -- cgit v1.2.3 From b146490e1b46799ccb35e156b4751eddea3a23ce Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Wed, 5 Sep 2012 17:46:11 -0400 Subject: SH-3264 Worked to move over mBakedTextureDatas from LLVOAvatar to LLAvatarAppearance. Appear to have been able to move over the parts that are common to both the backend and the viewer into LLAvatarAppearance. --- indra/llappearance/llavatarappearance.h | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'indra/llappearance/llavatarappearance.h') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 0e746b3b9d..9bff6b111e 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -30,6 +30,7 @@ #include "llcharacter.h" //#include "llframetimer.h" #include "llavatarappearancedefines.h" +#include "lljoint.h" class LLTexLayerSet; class LLTexGlobalColor; @@ -79,6 +80,7 @@ public: // Morph masks //-------------------------------------------------------------------- public: + void addMaskedMorph(LLAvatarAppearanceDefines::EBakedTextureIndex index, LLVisualParam* morph_target, BOOL invert, std::string layer); virtual void applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLAvatarAppearanceDefines::EBakedTextureIndex index = LLAvatarAppearanceDefines::BAKED_NUM_INDICES) = 0; /** Rendering @@ -153,6 +155,43 @@ public: virtual LLWearable* getWearable(const LLWearableType::EType type, U32 index /*= 0*/) = 0; virtual const LLWearable* getWearable(const LLWearableType::EType type, U32 index /*= 0*/) const = 0; +/******************************************************************************** + ** ** + ** BAKED TEXTURES + **/ +protected: + struct LLMaskedMorph; + typedef std::deque morph_list_t; + struct BakedTextureData + { + LLUUID mLastTextureIndex; + LLTexLayerSet* mTexLayerSet; // Only exists for self + bool mIsLoaded; + bool mIsUsed; + LLAvatarAppearanceDefines::ETextureIndex mTextureIndex; + U32 mMaskTexName; + // Stores pointers to the joint meshes that this baked texture deals with + std::vector< LLJoint* > mMeshes; // std::vector mJoints[i]->mMeshParts + morph_list_t mMaskedMorphs; + }; + typedef std::vector bakedtexturedata_vec_t; + bakedtexturedata_vec_t mBakedTextureDatas; + + +/******************************************************************************** + ** ** + ** SUPPORT CLASSES + **/ + + class LLMaskedMorph + { + public: + LLMaskedMorph(LLVisualParam *morph_target, BOOL invert, std::string layer); + + LLVisualParam *mMorphTarget; + BOOL mInvert; + std::string mLayer; + }; }; -- cgit v1.2.3 From 85d0bcc0630bfbf8b50be3a47a113c4f8d6ec9df Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Thu, 6 Sep 2012 02:53:55 +0000 Subject: Extracted mWearableDatas from LLAgentWearables into llappearance/LLWearableData. Moved LLDriverParam into llappearance --- indra/llappearance/llavatarappearance.h | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'indra/llappearance/llavatarappearance.h') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 0e746b3b9d..2209ede927 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -33,6 +33,7 @@ class LLTexLayerSet; class LLTexGlobalColor; +class LLWearableData; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // LLAvatarAppearance @@ -47,9 +48,12 @@ class LLAvatarAppearance : public LLCharacter ** ** ** INITIALIZATION **/ +private: + // Hide default constructor. + LLAvatarAppearance() {} public: - LLAvatarAppearance(); + LLAvatarAppearance(LLWearableData* wearable_data); virtual ~LLAvatarAppearance(); /** Initialization @@ -62,6 +66,7 @@ public: **/ public: virtual bool isSelf() const { return false; } // True if this avatar is for this viewer's agent + virtual BOOL isValid() const; virtual BOOL isUsingBakedTextures() const = 0; /** State @@ -145,15 +150,13 @@ public: **/ public: - virtual BOOL isWearingWearableType(LLWearableType::EType type ) const = 0; - - virtual U32 getWearableCount(const LLWearableType::EType type) const = 0; - virtual U32 getWearableCount(const U32 tex_index) const = 0; - - virtual LLWearable* getWearable(const LLWearableType::EType type, U32 index /*= 0*/) = 0; - virtual const LLWearable* getWearable(const LLWearableType::EType type, U32 index /*= 0*/) const = 0; - + LLWearableData* getWearableData() { return mWearableData; } + const LLWearableData* getWearableData() const { return mWearableData; } + virtual BOOL isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex te, U32 index = 0 ) const = 0; + virtual BOOL isWearingWearableType(LLWearableType::EType type ) const; +private: + LLWearableData* mWearableData; }; #endif // LL_AVATAR_APPEARANCE_H -- cgit v1.2.3 From 77b33d9623c08152932282048fe847d79fcf43cd Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Fri, 7 Sep 2012 23:17:34 -0400 Subject: SH-3264 Porting over the XML loading of the avatar structure to llappearance Moved over the necessary classes to llappearance to support the loading of the avatar's structure & params from file. --- indra/llappearance/llavatarappearance.h | 207 +++++++++++++++++++++++++++++++- 1 file changed, 205 insertions(+), 2 deletions(-) (limited to 'indra/llappearance/llavatarappearance.h') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index b2ab6b069f..38a54d904d 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -30,11 +30,17 @@ #include "llcharacter.h" //#include "llframetimer.h" #include "llavatarappearancedefines.h" -#include "lljoint.h" +#include "llavatarjoint.h" +#include "lldriverparam.h" +#include "lltexlayer.h" +#include "llviewervisualparam.h" +#include "llxmltree.h" class LLTexLayerSet; class LLTexGlobalColor; class LLWearableData; +class LLAvatarBoneInfo; +class LLAvatarSkeletonInfo; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // LLAvatarAppearance @@ -45,6 +51,9 @@ class LLAvatarAppearance : public LLCharacter { LOG_CLASS(LLAvatarAppearance); +protected: + struct LLAvatarXmlInfo; + /******************************************************************************** ** ** ** INITIALIZATION @@ -57,6 +66,12 @@ public: LLAvatarAppearance(LLWearableData* wearable_data); virtual ~LLAvatarAppearance(); + static void initClass(); // initializes static members + virtual BOOL loadSkeletonNode(); + virtual BOOL loadMeshNodes(); + virtual BOOL loadLayersets(); + + /** Initialization ** ** *******************************************************************************/ @@ -69,16 +84,94 @@ public: virtual bool isSelf() const { return false; } // True if this avatar is for this viewer's agent virtual BOOL isValid() const; virtual BOOL isUsingBakedTextures() const = 0; + + bool isBuilt() const { return mIsBuilt; } + /** State ** ** *******************************************************************************/ +/******************************************************************************** + ** ** + ** SKELETON + **/ + +public: + F32 getPelvisToFoot() const { return mPelvisToFoot; } + + LLVector3 mHeadOffset; // current head position + LLAvatarJoint *mRoot; + + typedef std::map joint_map_t; + joint_map_t mJointMap; + +protected: + static BOOL parseSkeletonFile(const std::string& filename); + virtual void buildCharacter(); + virtual BOOL loadAvatar(); + virtual void bodySizeChanged() = 0; + void computeBodySize(); + + BOOL setupBone(const LLAvatarBoneInfo* info, LLJoint* parent, S32 ¤t_volume_num, S32 ¤t_joint_num); + BOOL buildSkeleton(const LLAvatarSkeletonInfo *info); +protected: + BOOL mIsBuilt; // state of deferred character building + S32 mNumJoints; + LLJoint* mSkeleton; + + //-------------------------------------------------------------------- + // Pelvis height adjustment members. + //-------------------------------------------------------------------- +public: + LLVector3 mBodySize; +protected: + F32 mPelvisToFoot; + + //-------------------------------------------------------------------- + // Cached pointers to well known joints + //-------------------------------------------------------------------- +public: + LLJoint* mPelvisp; + LLJoint* mTorsop; + LLJoint* mChestp; + LLJoint* mNeckp; + LLJoint* mHeadp; + LLJoint* mSkullp; + LLJoint* mEyeLeftp; + LLJoint* mEyeRightp; + LLJoint* mHipLeftp; + LLJoint* mHipRightp; + LLJoint* mKneeLeftp; + LLJoint* mKneeRightp; + LLJoint* mAnkleLeftp; + LLJoint* mAnkleRightp; + LLJoint* mFootLeftp; + LLJoint* mFootRightp; + LLJoint* mWristLeftp; + LLJoint* mWristRightp; + + //-------------------------------------------------------------------- + // XML parse tree + //-------------------------------------------------------------------- +protected: + static LLXmlTree sXMLTree; // avatar config file + static LLXmlTree sSkeletonXMLTree; // avatar skeleton file + + static LLAvatarSkeletonInfo* sAvatarSkeletonInfo; + static LLAvatarXmlInfo* sAvatarXmlInfo; + + +/** Skeleton + ** ** + *******************************************************************************/ + /******************************************************************************** ** ** ** RENDERING **/ +public: BOOL mIsDummy; // for special views //-------------------------------------------------------------------- @@ -109,6 +202,11 @@ public: protected: virtual void dirtyMesh(S32 priority) = 0; // Dirty the avatar mesh, with priority +protected: + typedef std::multimap polymesh_map_t; + polymesh_map_t mMeshes; + std::vector mMeshLOD; + /** Meshes ** ** *******************************************************************************/ @@ -182,12 +280,115 @@ protected: typedef std::vector bakedtexturedata_vec_t; bakedtexturedata_vec_t mBakedTextureDatas; +/******************************************************************************** + ** ** + ** PHYSICS + **/ + + //-------------------------------------------------------------------- + // Collision volumes + //-------------------------------------------------------------------- +public: + S32 mNumCollisionVolumes; + LLAvatarJointCollisionVolume* mCollisionVolumes; +protected: + BOOL allocateCollisionVolumes(U32 num); + +/** Physics + ** ** + *******************************************************************************/ /******************************************************************************** ** ** ** SUPPORT CLASSES **/ + struct LLAvatarXmlInfo + { + LLAvatarXmlInfo(); + ~LLAvatarXmlInfo(); + + BOOL parseXmlSkeletonNode(LLXmlTreeNode* root); + BOOL parseXmlMeshNodes(LLXmlTreeNode* root); + BOOL parseXmlColorNodes(LLXmlTreeNode* root); + BOOL parseXmlLayerNodes(LLXmlTreeNode* root); + BOOL parseXmlDriverNodes(LLXmlTreeNode* root); + BOOL parseXmlMorphNodes(LLXmlTreeNode* root); + + struct LLAvatarMeshInfo + { + typedef std::pair morph_info_pair_t; // LLPolyMorphTargetInfo stored here + typedef std::vector morph_info_list_t; + + LLAvatarMeshInfo() : mLOD(0), mMinPixelArea(.1f) {} + ~LLAvatarMeshInfo() + { + morph_info_list_t::iterator iter; + for (iter = mPolyMorphTargetInfoList.begin(); iter != mPolyMorphTargetInfoList.end(); iter++) + { + delete iter->first; + } + mPolyMorphTargetInfoList.clear(); + } + + std::string mType; + S32 mLOD; + std::string mMeshFileName; + std::string mReferenceMeshName; + F32 mMinPixelArea; + morph_info_list_t mPolyMorphTargetInfoList; + }; + typedef std::vector mesh_info_list_t; + mesh_info_list_t mMeshInfoList; + + typedef std::vector skeletal_distortion_info_list_t; // LLPolySkeletalDistortionInfo stored here + skeletal_distortion_info_list_t mSkeletalDistortionInfoList; + + struct LLAvatarAttachmentInfo + { + LLAvatarAttachmentInfo() + : mGroup(-1), mAttachmentID(-1), mPieMenuSlice(-1), mVisibleFirstPerson(FALSE), + mIsHUDAttachment(FALSE), mHasPosition(FALSE), mHasRotation(FALSE) {} + std::string mName; + std::string mJointName; + LLVector3 mPosition; + LLVector3 mRotationEuler; + S32 mGroup; + S32 mAttachmentID; + S32 mPieMenuSlice; + BOOL mVisibleFirstPerson; + BOOL mIsHUDAttachment; + BOOL mHasPosition; + BOOL mHasRotation; + }; + typedef std::vector attachment_info_list_t; + attachment_info_list_t mAttachmentInfoList; + + LLTexGlobalColorInfo *mTexSkinColorInfo; + LLTexGlobalColorInfo *mTexHairColorInfo; + LLTexGlobalColorInfo *mTexEyeColorInfo; + + typedef std::vector layer_info_list_t; + layer_info_list_t mLayerInfoList; + + typedef std::vector driver_info_list_t; + driver_info_list_t mDriverInfoList; + + struct LLAvatarMorphInfo + { + LLAvatarMorphInfo() + : mInvert(FALSE) {} + std::string mName; + std::string mRegion; + std::string mLayer; + BOOL mInvert; + }; + + typedef std::vector morph_info_list_t; + morph_info_list_t mMorphMaskInfoList; + }; + + class LLMaskedMorph { public: @@ -197,7 +398,9 @@ protected: BOOL mInvert; std::string mLayer; }; - +/** Support Classes + ** ** + *******************************************************************************/ }; #endif // LL_AVATAR_APPEARANCE_H -- cgit v1.2.3 From e1580128ab2a42ecd4019ef35069f9e939dc4ff2 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Sun, 9 Sep 2012 12:12:19 +0000 Subject: Fixed crashes on login. Moved most of the remaining character/skeleton generation code into llappearance. Moved non-rendering related LLViewerJoint functionality into LLAvatarJoint. --- indra/llappearance/llavatarappearance.h | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'indra/llappearance/llavatarappearance.h') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 38a54d904d..96dd81be77 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -28,9 +28,8 @@ #define LL_AVATAR_APPEARANCE_H #include "llcharacter.h" -//#include "llframetimer.h" #include "llavatarappearancedefines.h" -#include "llavatarjoint.h" +#include "llavatarjointmesh.h" #include "lldriverparam.h" #include "lltexlayer.h" #include "llviewervisualparam.h" @@ -67,9 +66,10 @@ public: virtual ~LLAvatarAppearance(); static void initClass(); // initializes static members + virtual void initInstance(); // Called after construction to initialize the instance. virtual BOOL loadSkeletonNode(); - virtual BOOL loadMeshNodes(); - virtual BOOL loadLayersets(); + BOOL loadMeshNodes(); + BOOL loadLayersets(); /** Initialization @@ -97,8 +97,13 @@ public: ** SKELETON **/ +protected: + virtual LLAvatarJoint* createAvatarJoint() = 0; + virtual LLAvatarJoint* createAvatarJoint(S32 joint_num) = 0; + virtual LLAvatarJointMesh* createAvatarJointMesh() = 0; public: F32 getPelvisToFoot() const { return mPelvisToFoot; } + /*virtual*/ LLJoint* getRootJoint() { return mRoot; } LLVector3 mHeadOffset; // current head position LLAvatarJoint *mRoot; @@ -114,11 +119,13 @@ protected: void computeBodySize(); BOOL setupBone(const LLAvatarBoneInfo* info, LLJoint* parent, S32 ¤t_volume_num, S32 ¤t_joint_num); + BOOL allocateCharacterJoints(U32 num); BOOL buildSkeleton(const LLAvatarSkeletonInfo *info); protected: + void clearSkeleton(); BOOL mIsBuilt; // state of deferred character building - S32 mNumJoints; - LLJoint* mSkeleton; + typedef std::vector avatar_joint_list_t; + avatar_joint_list_t mSkeleton; //-------------------------------------------------------------------- // Pelvis height adjustment members. @@ -204,8 +211,8 @@ protected: protected: typedef std::multimap polymesh_map_t; - polymesh_map_t mMeshes; - std::vector mMeshLOD; + polymesh_map_t mPolyMeshes; + avatar_joint_list_t mMeshLOD; /** Meshes ** ** @@ -262,6 +269,8 @@ private: ** ** ** BAKED TEXTURES **/ +protected: + virtual LLTexLayerSet* createTexLayerSet() = 0; protected: struct LLMaskedMorph; typedef std::deque morph_list_t; @@ -274,7 +283,7 @@ protected: LLAvatarAppearanceDefines::ETextureIndex mTextureIndex; U32 mMaskTexName; // Stores pointers to the joint meshes that this baked texture deals with - std::vector< LLJoint* > mMeshes; // std::vector mJoints[i]->mMeshParts + avatar_joint_mesh_list_t mJointMeshes; morph_list_t mMaskedMorphs; }; typedef std::vector bakedtexturedata_vec_t; -- cgit v1.2.3 From d3cdc92039349ba44cc62c616a8a040236ea696d Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 10 Sep 2012 11:34:17 -0400 Subject: BUILDFIX WIN fixing windows build error converted a struct to a class, cleaning up a forward declaration that caused windows build issues. --- indra/llappearance/llavatarappearance.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llappearance/llavatarappearance.h') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 96dd81be77..6eab9b9d1f 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -272,7 +272,7 @@ private: protected: virtual LLTexLayerSet* createTexLayerSet() = 0; protected: - struct LLMaskedMorph; + class LLMaskedMorph; typedef std::deque morph_list_t; struct BakedTextureData { -- cgit v1.2.3 From f1d6052e36ed6d817faedf9b32cb9d889395cd88 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 11 Sep 2012 11:59:45 -0400 Subject: SH-3264 Moved over a few more items to llappearance moved over: isWearingWearableType wearable::writeToAvatar wearable::mTEMap (stores LocalTextureObject*) more from wearable::import/export wearable::createVisualParams, etc --- indra/llappearance/llavatarappearance.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llappearance/llavatarappearance.h') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 6eab9b9d1f..b512fd4eda 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -269,8 +269,12 @@ private: ** ** ** BAKED TEXTURES **/ +public: + LLTexLayerSet* getAvatarLayerSet(LLAvatarAppearanceDefines::EBakedTextureIndex baked_index) const; + protected: virtual LLTexLayerSet* createTexLayerSet() = 0; + protected: class LLMaskedMorph; typedef std::deque morph_list_t; -- cgit v1.2.3 From 929b7e029513ecbb08c415e945c83ea09dc1b3eb Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Thu, 13 Sep 2012 03:30:17 +0000 Subject: Instantiated bare-bones LLBakingAvatar concrete class (derived from LLAvatarAppearance). Moved some LLCharacter funcionality from LLVOAvatar to LLAvatarAppearance. --- indra/llappearance/llavatarappearance.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'indra/llappearance/llavatarappearance.h') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index b512fd4eda..06607ef899 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -76,6 +76,28 @@ public: ** ** *******************************************************************************/ +/******************************************************************************** + ** ** + ** INHERITED + **/ + + //-------------------------------------------------------------------- + // LLCharacter interface and related + //-------------------------------------------------------------------- +public: + /*virtual*/ LLJoint* getCharacterJoint(U32 num); + + /*virtual*/ const char* getAnimationPrefix() { return "avatar"; } + /*virtual*/ LLVector3 getVolumePos(S32 joint_index, LLVector3& volume_offset); + /*virtual*/ LLJoint* findCollisionVolume(U32 volume_id); + /*virtual*/ S32 getCollisionVolumeID(std::string &name); + /*virtual*/ LLPolyMesh* getHeadMesh(); + /*virtual*/ LLPolyMesh* getUpperBodyMesh(); + +/** Inherited + ** ** + *******************************************************************************/ + /******************************************************************************** ** ** ** STATE -- cgit v1.2.3 From 8ba2b388769e245ec1b49b7d6d4b0372d684ff86 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Thu, 13 Sep 2012 10:25:48 +0000 Subject: Fleshed out target_link_libraries dependencies between libraries. Appearance utility now reads avatar_lad.xml during stubbed out params processing. --- indra/llappearance/llavatarappearance.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llappearance/llavatarappearance.h') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 06607ef899..5726ff62d1 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -65,7 +65,8 @@ public: LLAvatarAppearance(LLWearableData* wearable_data); virtual ~LLAvatarAppearance(); - static void initClass(); // initializes static members + static void initClass(); // initializes static members + static void cleanupClass(); // Cleanup data that's only init'd once per class. virtual void initInstance(); // Called after construction to initialize the instance. virtual BOOL loadSkeletonNode(); BOOL loadMeshNodes(); -- cgit v1.2.3 From 7153d1db11c00245a379fa9601f092020152ea73 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Thu, 20 Sep 2012 04:29:17 +0000 Subject: Partial rewrite of llifstream and llofstream (Windows implementation pending). Moved more functionality from llviewerwearable to llwearable --- indra/llappearance/llavatarappearance.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llappearance/llavatarappearance.h') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 5726ff62d1..4f57335688 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -37,6 +37,7 @@ class LLTexLayerSet; class LLTexGlobalColor; +class LLTexGlobalColorInfo; class LLWearableData; class LLAvatarBoneInfo; class LLAvatarSkeletonInfo; -- cgit v1.2.3 From 3171c2414fd622f72c23e796d5cf54fb84f8eff0 Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Fri, 21 Sep 2012 18:22:36 +0000 Subject: Making computeBodySize public --- indra/llappearance/llavatarappearance.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/llappearance/llavatarappearance.h') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 4f57335688..a27779e295 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -134,13 +134,15 @@ public: typedef std::map joint_map_t; joint_map_t mJointMap; + + void computeBodySize(); + protected: static BOOL parseSkeletonFile(const std::string& filename); virtual void buildCharacter(); virtual BOOL loadAvatar(); virtual void bodySizeChanged() = 0; - void computeBodySize(); BOOL setupBone(const LLAvatarBoneInfo* info, LLJoint* parent, S32 ¤t_volume_num, S32 ¤t_joint_num); BOOL allocateCharacterJoints(U32 num); -- cgit v1.2.3 From ae0bb922909af95d96c140c1d74a4f39a264d4ec Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 26 Sep 2012 06:36:24 -0400 Subject: renamed isUsingBakedTextures to more accurate isUsingServerBakes. Commented some areas we are probably using the function incorrectly --- indra/llappearance/llavatarappearance.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) mode change 100644 => 100755 indra/llappearance/llavatarappearance.h (limited to 'indra/llappearance/llavatarappearance.h') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h old mode 100644 new mode 100755 index 5726ff62d1..2aa43d25d2 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -106,7 +106,9 @@ public: public: virtual bool isSelf() const { return false; } // True if this avatar is for this viewer's agent virtual BOOL isValid() const; - virtual BOOL isUsingBakedTextures() const = 0; + virtual BOOL isUsingServerBakes() const = 0; + virtual BOOL isUsingLocalAppearance() const = 0; + virtual BOOL isEditingAppearance() const = 0; bool isBuilt() const { return mIsBuilt; } -- cgit v1.2.3 From ee2bc008ea8f04ffd1271787382a2b756e6293aa Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 5 Nov 2012 18:02:03 -0500 Subject: renamed a confusingly-named field --- indra/llappearance/llavatarappearance.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llappearance/llavatarappearance.h') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index abe3599685..11ea5e5a46 100755 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -308,7 +308,7 @@ protected: typedef std::deque morph_list_t; struct BakedTextureData { - LLUUID mLastTextureIndex; + LLUUID mLastTextureID; LLTexLayerSet* mTexLayerSet; // Only exists for self bool mIsLoaded; bool mIsUsed; -- cgit v1.2.3 From d1c144519306cae7eff7f781417482c85068988c Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Thu, 28 Feb 2013 17:25:37 -0500 Subject: SH-3909 Support avatar height offset Adding a new visual param that allows users to manually adjust an offset for how far off the ground (+ or -) their avatar's root bone is. Supports the +-2m range people are used to adjusting in their viewers, but new implementation should support server-generated appearances. --- indra/llappearance/llavatarappearance.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llappearance/llavatarappearance.h') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 11ea5e5a46..bce2540258 100755 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -160,6 +160,7 @@ protected: //-------------------------------------------------------------------- public: LLVector3 mBodySize; + LLVector3 mAvatarOffset; protected: F32 mPelvisToFoot; -- cgit v1.2.3