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/llavatarappearancedefines.h | 226 +++++++++++++++++++++++++ 1 file changed, 226 insertions(+) create mode 100644 indra/llappearance/llavatarappearancedefines.h (limited to 'indra/llappearance/llavatarappearancedefines.h') diff --git a/indra/llappearance/llavatarappearancedefines.h b/indra/llappearance/llavatarappearancedefines.h new file mode 100644 index 0000000000..c5285ddc02 --- /dev/null +++ b/indra/llappearance/llavatarappearancedefines.h @@ -0,0 +1,226 @@ +/** + * @file llavatarappearancedefines.h + * @brief Various LLAvatarAppearance related definitions + * LLViewerObject + * + * $LicenseInfo:firstyear=2001&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_AVATARAPPEARANCE_DEFINES_H +#define LL_AVATARAPPEARANCE_DEFINES_H + +#include +#include "llwearable.h" +#include "lljointpickname.h" +#include "lldictionary.h" + +namespace LLAvatarAppearanceDefines +{ + +extern const S32 SCRATCH_TEX_WIDTH; +extern const S32 SCRATCH_TEX_HEIGHT; +extern const S32 IMPOSTOR_PERIOD; + +//-------------------------------------------------------------------- +// Enums +//-------------------------------------------------------------------- +enum ETextureIndex +{ + TEX_HEAD_BODYPAINT = 0, + TEX_UPPER_SHIRT, + TEX_LOWER_PANTS, + TEX_EYES_IRIS, + TEX_HAIR, + TEX_UPPER_BODYPAINT, + TEX_LOWER_BODYPAINT, + TEX_LOWER_SHOES, + TEX_HEAD_BAKED, // Pre-composited + TEX_UPPER_BAKED, // Pre-composited + TEX_LOWER_BAKED, // Pre-composited + TEX_EYES_BAKED, // Pre-composited + TEX_LOWER_SOCKS, + TEX_UPPER_JACKET, + TEX_LOWER_JACKET, + TEX_UPPER_GLOVES, + TEX_UPPER_UNDERSHIRT, + TEX_LOWER_UNDERPANTS, + TEX_SKIRT, + TEX_SKIRT_BAKED, // Pre-composited + TEX_HAIR_BAKED, // Pre-composited + TEX_LOWER_ALPHA, + TEX_UPPER_ALPHA, + TEX_HEAD_ALPHA, + TEX_EYES_ALPHA, + TEX_HAIR_ALPHA, + TEX_HEAD_TATTOO, + TEX_UPPER_TATTOO, + TEX_LOWER_TATTOO, + TEX_NUM_INDICES +}; + +enum EBakedTextureIndex +{ + BAKED_HEAD = 0, + BAKED_UPPER, + BAKED_LOWER, + BAKED_EYES, + BAKED_SKIRT, + BAKED_HAIR, + BAKED_NUM_INDICES +}; + +// Reference IDs for each mesh. Used as indices for vector of joints +enum EMeshIndex +{ + MESH_ID_HAIR = 0, + MESH_ID_HEAD, + MESH_ID_EYELASH, + MESH_ID_UPPER_BODY, + MESH_ID_LOWER_BODY, + MESH_ID_EYEBALL_LEFT, + MESH_ID_EYEBALL_RIGHT, + MESH_ID_SKIRT, + MESH_ID_NUM_INDICES +}; + +//-------------------------------------------------------------------- +// Vector Types +//-------------------------------------------------------------------- +typedef std::vector texture_vec_t; +typedef std::vector bakedtexture_vec_t; +typedef std::vector mesh_vec_t; +typedef std::vector wearables_vec_t; + +//------------------------------------------------------------------------ +// LLAvatarAppearanceDictionary +// +// Holds dictionary static entries for textures, baked textures, meshes, etc.; i.e. +// information that is common to all avatars. +// +// This holds const data - it is initialized once and the contents never change after that. +//------------------------------------------------------------------------ +class LLAvatarAppearanceDictionary : public LLSingleton +{ + //-------------------------------------------------------------------- + // Constructors and Destructors + //-------------------------------------------------------------------- +public: + LLAvatarAppearanceDictionary(); + virtual ~LLAvatarAppearanceDictionary(); +private: + void createAssociations(); + + //-------------------------------------------------------------------- + // Local and baked textures + //-------------------------------------------------------------------- +public: + struct TextureEntry : public LLDictionaryEntry + { + TextureEntry(const std::string &name, // this must match the xml name used by LLTexLayerInfo::parseXml + bool is_local_texture, + EBakedTextureIndex baked_texture_index = BAKED_NUM_INDICES, + const std::string& default_image_name = "", + LLWearableType::EType wearable_type = LLWearableType::WT_INVALID); + const std::string mDefaultImageName; + const LLWearableType::EType mWearableType; + // It's either a local texture xor baked + BOOL mIsLocalTexture; + BOOL mIsBakedTexture; + // If it's a local texture, it may be used by a baked texture + BOOL mIsUsedByBakedTexture; + EBakedTextureIndex mBakedTextureIndex; + }; + + struct Textures : public LLDictionary + { + Textures(); + } mTextures; + const TextureEntry* getTexture(ETextureIndex index) const { return mTextures.lookup(index); } + const Textures& getTextures() const { return mTextures; } + + //-------------------------------------------------------------------- + // Meshes + //-------------------------------------------------------------------- +public: + struct MeshEntry : public LLDictionaryEntry + { + MeshEntry(EBakedTextureIndex baked_index, + const std::string &name, // names of mesh types as they are used in avatar_lad.xml + U8 level, + LLJointPickName pick); + // Levels of Detail for each mesh. Must match levels of detail present in avatar_lad.xml + // Otherwise meshes will be unable to be found, or levels of detail will be ignored + const U8 mLOD; + const EBakedTextureIndex mBakedID; + const LLJointPickName mPickName; + }; + + struct Meshes : public LLDictionary + { + Meshes(); + } mMeshes; + const MeshEntry* getMesh(EMeshIndex index) const { return mMeshes.lookup(index); } + const Meshes& getMeshes() const { return mMeshes; } + + //-------------------------------------------------------------------- + // Baked Textures + //-------------------------------------------------------------------- +public: + struct BakedEntry : public LLDictionaryEntry + { + BakedEntry(ETextureIndex tex_index, + const std::string &name, // unused, but necessary for templating. + const std::string &hash_name, + U32 num_local_textures, ... ); // # local textures, local texture list, # wearables, wearable list + // Local Textures + const ETextureIndex mTextureIndex; + texture_vec_t mLocalTextures; + // Wearables + const LLUUID mWearablesHashID; + wearables_vec_t mWearables; + }; + + struct BakedTextures: public LLDictionary + { + BakedTextures(); + } mBakedTextures; + const BakedEntry* getBakedTexture(EBakedTextureIndex index) const { return mBakedTextures.lookup(index); } + const BakedTextures& getBakedTextures() const { return mBakedTextures; } + + //-------------------------------------------------------------------- + // Convenience Functions + //-------------------------------------------------------------------- +public: + // Convert from baked texture to associated texture; e.g. BAKED_HEAD -> TEX_HEAD_BAKED + static ETextureIndex bakedToLocalTextureIndex(EBakedTextureIndex t); + + // find a baked texture index based on its name + static EBakedTextureIndex findBakedByRegionName(std::string name); + + // Given a texture entry, determine which wearable type owns it. + static LLWearableType::EType getTEWearableType(ETextureIndex index); + +}; // End LLAvatarAppearanceDictionary + +} // End namespace LLAvatarAppearanceDefines + +#endif //LL_AVATARAPPEARANCE_DEFINES_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/llavatarappearancedefines.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/llappearance/llavatarappearancedefines.h') diff --git a/indra/llappearance/llavatarappearancedefines.h b/indra/llappearance/llavatarappearancedefines.h index c5285ddc02..e7c94104cc 100644 --- a/indra/llappearance/llavatarappearancedefines.h +++ b/indra/llappearance/llavatarappearancedefines.h @@ -174,12 +174,12 @@ public: const LLJointPickName mPickName; }; - struct Meshes : public LLDictionary + struct MeshEntries : public LLDictionary { - Meshes(); - } mMeshes; - const MeshEntry* getMesh(EMeshIndex index) const { return mMeshes.lookup(index); } - const Meshes& getMeshes() const { return mMeshes; } + MeshEntries(); + } mMeshEntries; + const MeshEntry* getMeshEntry(EMeshIndex index) const { return mMeshEntries.lookup(index); } + const MeshEntries& getMeshEntries() const { return mMeshEntries; } //-------------------------------------------------------------------- // Baked Textures -- 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/llavatarappearancedefines.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llappearance/llavatarappearancedefines.h') diff --git a/indra/llappearance/llavatarappearancedefines.h b/indra/llappearance/llavatarappearancedefines.h index e7c94104cc..0351f28429 100644 --- a/indra/llappearance/llavatarappearancedefines.h +++ b/indra/llappearance/llavatarappearancedefines.h @@ -29,9 +29,10 @@ #define LL_AVATARAPPEARANCE_DEFINES_H #include -#include "llwearable.h" #include "lljointpickname.h" #include "lldictionary.h" +#include "llwearabletype.h" +#include "lluuid.h" namespace LLAvatarAppearanceDefines { -- cgit v1.2.3 From 0a94b5bb390675bb1746f24c8352e73240a8d670 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Fri, 28 Sep 2012 23:56:55 +0000 Subject: Exposing more tex layer information for hash id generation --- indra/llappearance/llavatarappearancedefines.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llappearance/llavatarappearancedefines.h') diff --git a/indra/llappearance/llavatarappearancedefines.h b/indra/llappearance/llavatarappearancedefines.h index 0351f28429..2e073bf5d2 100644 --- a/indra/llappearance/llavatarappearancedefines.h +++ b/indra/llappearance/llavatarappearancedefines.h @@ -46,6 +46,7 @@ extern const S32 IMPOSTOR_PERIOD; //-------------------------------------------------------------------- enum ETextureIndex { + TEX_INVALID = -1, TEX_HEAD_BODYPAINT = 0, TEX_UPPER_SHIRT, TEX_LOWER_PANTS, -- cgit v1.2.3 From 5483bc28ae6b33bf5b2371d46648ad20975daf8c Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Tue, 2 Oct 2012 01:02:34 +0000 Subject: Moved gatherMorphMaskAlpha into llappearance. --- indra/llappearance/llavatarappearancedefines.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llappearance/llavatarappearancedefines.h') diff --git a/indra/llappearance/llavatarappearancedefines.h b/indra/llappearance/llavatarappearancedefines.h index 2e073bf5d2..496f85c107 100644 --- a/indra/llappearance/llavatarappearancedefines.h +++ b/indra/llappearance/llavatarappearancedefines.h @@ -217,6 +217,7 @@ public: // find a baked texture index based on its name static EBakedTextureIndex findBakedByRegionName(std::string name); + static EBakedTextureIndex findBakedByImageName(std::string name); // Given a texture entry, determine which wearable type owns it. static LLWearableType::EType getTEWearableType(ETextureIndex index); -- cgit v1.2.3 From b724791c2adb3e63c00547c40de2ae1b6ce45b9b Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Wed, 3 Apr 2013 18:59:50 -0400 Subject: SH-4050 FIX camera goes below ground when avatar offset set to 0 Added a constraint to ensure that the avatar's height (with offset) does not go below 0.1 meters. Camera was getting confused since the avatar's effective height was negative. Note the avatar is mostly underground/contorted even at 0.1 meters, but most users setting values this low will be making ultra-tinies and would be hiding the avatar mesh. Camera stays above ground when height is at 0.1. --- indra/llappearance/llavatarappearancedefines.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llappearance/llavatarappearancedefines.h') diff --git a/indra/llappearance/llavatarappearancedefines.h b/indra/llappearance/llavatarappearancedefines.h index 496f85c107..8a1d2c4707 100644 --- a/indra/llappearance/llavatarappearancedefines.h +++ b/indra/llappearance/llavatarappearancedefines.h @@ -41,6 +41,8 @@ extern const S32 SCRATCH_TEX_WIDTH; extern const S32 SCRATCH_TEX_HEIGHT; extern const S32 IMPOSTOR_PERIOD; +static const U32 AVATAR_HOVER = 11001; + //-------------------------------------------------------------------- // Enums //-------------------------------------------------------------------- -- cgit v1.2.3