Completed code migration to LLAvatarAppearance
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -41,9 +41,6 @@ class LLTexGlobalColorInfo;
|
||||
class LLWearableData;
|
||||
class LLAvatarBoneInfo;
|
||||
class LLAvatarSkeletonInfo;
|
||||
class LLPolyMeshSharedData;
|
||||
class LLAvatarJointCollisionVolume;
|
||||
class LLTexLayerSet;
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// LLAvatarAppearance
|
||||
@@ -55,7 +52,7 @@ class LLAvatarAppearance : public LLCharacter
|
||||
LOG_CLASS(LLAvatarAppearance);
|
||||
|
||||
protected:
|
||||
// struct LLAvatarXmlInfo;
|
||||
struct LLAvatarXmlInfo;
|
||||
|
||||
/********************************************************************************
|
||||
** **
|
||||
@@ -66,12 +63,15 @@ private:
|
||||
LLAvatarAppearance() {}
|
||||
|
||||
public:
|
||||
LLAvatarAppearance(LLWearableData* wearable_data) : mIsDummy(FALSE), mWearableData(wearable_data) {};
|
||||
virtual ~LLAvatarAppearance() {}
|
||||
LLAvatarAppearance(LLWearableData* wearable_data);
|
||||
virtual ~LLAvatarAppearance();
|
||||
|
||||
virtual BOOL loadSkeletonNode() = 0;
|
||||
virtual BOOL loadMeshNodes() = 0;
|
||||
virtual BOOL loadLayersets() = 0;
|
||||
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();
|
||||
BOOL loadLayersets();
|
||||
|
||||
|
||||
/** Initialization
|
||||
@@ -87,14 +87,19 @@ public:
|
||||
// LLCharacter interface and related
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
///*virtual*/ LLJoint* getCharacterJoint(U32 num);
|
||||
/*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();
|
||||
/*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();
|
||||
LLPolyMesh* getMesh( LLPolyMeshSharedData *shared_data );
|
||||
|
||||
typedef std::map<S32, std::string> lod_mesh_map_t;
|
||||
typedef std::map<std::string, lod_mesh_map_t> mesh_info_t;
|
||||
static void getMeshInfo(mesh_info_t* mesh_info);
|
||||
|
||||
/** Inherited
|
||||
** **
|
||||
@@ -105,17 +110,17 @@ public:
|
||||
** STATE
|
||||
**/
|
||||
public:
|
||||
virtual bool isSelf() const = 0;// True if this avatar is for this viewer's agent
|
||||
//virtual BOOL isValid() const = 0;
|
||||
virtual bool isAgent() const = 0;
|
||||
virtual bool isUsingBakedTextures() const {return false;}
|
||||
virtual bool isSelf() const { return false; } // True if this avatar is for this viewer's agent
|
||||
virtual BOOL isValid() const;
|
||||
//virtual BOOL isUsingServerBakes() const = 0;
|
||||
//virtual BOOL isUsingLocalAppearance() const = 0;
|
||||
//virtual BOOL isEditingAppearance() const = 0;
|
||||
BOOL isUsingLocalAppearance() const {return isEditingAppearance();}
|
||||
virtual BOOL isEditingAppearance() const {return FALSE;}
|
||||
|
||||
virtual bool isBuilt() const = 0;
|
||||
bool isBuilt() const { return mIsBuilt; }
|
||||
|
||||
|
||||
virtual std::string getFullname() const = 0;
|
||||
/** State
|
||||
** **
|
||||
*******************************************************************************/
|
||||
@@ -126,50 +131,50 @@ public:
|
||||
**/
|
||||
|
||||
protected:
|
||||
//virtual LLAvatarJoint* createAvatarJoint() = 0;
|
||||
//virtual LLAvatarJoint* createAvatarJoint(S32 joint_num) = 0;
|
||||
//virtual LLAvatarJointMesh* createAvatarJointMesh() = 0;
|
||||
virtual LLAvatarJoint* createAvatarJoint() = 0;
|
||||
virtual LLAvatarJoint* createAvatarJoint(S32 joint_num) = 0;
|
||||
virtual LLAvatarJointMesh* createAvatarJointMesh() = 0;
|
||||
public:
|
||||
virtual F32 getPelvisToFoot() const = 0;
|
||||
//*virtual*/ LLJoint* getRootJoint() { return mRoot; } //LLCharacter
|
||||
F32 getPelvisToFoot() const { return mPelvisToFoot; }
|
||||
/*virtual*/ LLJoint* getRootJoint() { return mRoot; }
|
||||
|
||||
//LLVector3 mHeadOffset; // current head position
|
||||
//LLAvatarJoint *mRoot;
|
||||
LLVector3 mHeadOffset; // current head position
|
||||
LLAvatarJoint *mRoot;
|
||||
|
||||
//typedef std::map<std::string, LLJoint*> joint_map_t;
|
||||
//joint_map_t mJointMap;
|
||||
typedef std::map<std::string, LLJoint*> joint_map_t;
|
||||
joint_map_t mJointMap;
|
||||
|
||||
virtual void computeBodySize() = 0;
|
||||
void computeBodySize();
|
||||
|
||||
|
||||
public:
|
||||
//static BOOL parseSkeletonFile(const std::string& filename);
|
||||
virtual void buildCharacter() = 0;
|
||||
virtual BOOL loadAvatar() = 0;
|
||||
//virtual void bodySizeChanged() = 0;
|
||||
|
||||
//BOOL setupBone(const LLAvatarBoneInfo* info, LLJoint* parent, S32 ¤t_volume_num, S32 ¤t_joint_num);
|
||||
//BOOL allocateCharacterJoints(U32 num); //LLCharacter
|
||||
virtual BOOL buildSkeleton(const LLAvatarSkeletonInfo *info) = 0;
|
||||
protected:
|
||||
//void clearSkeleton();
|
||||
//BOOL mIsBuilt; // state of deferred character building
|
||||
//typedef std::vector<LLAvatarJoint*> avatar_joint_list_t;
|
||||
//avatar_joint_list_t mSkeleton;
|
||||
static BOOL parseSkeletonFile(const std::string& filename);
|
||||
virtual void buildCharacter();
|
||||
virtual BOOL loadAvatar();
|
||||
virtual void bodySizeChanged() = 0;
|
||||
|
||||
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
|
||||
typedef std::vector<LLAvatarJoint*> avatar_joint_list_t;
|
||||
avatar_joint_list_t mSkeleton;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Pelvis height adjustment members.
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
//LLVector3 mBodySize;
|
||||
LLVector3 mBodySize;
|
||||
protected:
|
||||
//F32 mPelvisToFoot;
|
||||
F32 mPelvisToFoot;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Cached pointers to well known joints
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
/*LLJoint* mPelvisp;
|
||||
LLJoint* mPelvisp;
|
||||
LLJoint* mTorsop;
|
||||
LLJoint* mChestp;
|
||||
LLJoint* mNeckp;
|
||||
@@ -196,7 +201,7 @@ protected:
|
||||
static LLXmlTree sSkeletonXMLTree; // avatar skeleton file
|
||||
|
||||
static LLAvatarSkeletonInfo* sAvatarSkeletonInfo;
|
||||
static LLAvatarXmlInfo* sAvatarXmlInfo;*/
|
||||
static LLAvatarXmlInfo* sAvatarXmlInfo;
|
||||
|
||||
|
||||
/** Skeleton
|
||||
@@ -215,7 +220,7 @@ public:
|
||||
// Morph masks
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
virtual void addMaskedMorph(LLAvatarAppearanceDefines::EBakedTextureIndex index, LLVisualParam* morph_target, BOOL invert, std::string layer) = 0;
|
||||
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
|
||||
@@ -236,14 +241,13 @@ public:
|
||||
public:
|
||||
virtual void updateMeshTextures() = 0;
|
||||
virtual void dirtyMesh() = 0; // Dirty the avatar mesh
|
||||
public:
|
||||
virtual void dirtyMesh(S32 priority) = 0; // Dirty the avatar mesh, with priority
|
||||
|
||||
virtual LLPolyMesh* getMesh(LLPolyMeshSharedData* shared_data) = 0;
|
||||
protected:
|
||||
//typedef std::multimap<std::string, LLPolyMesh*> polymesh_map_t;
|
||||
//polymesh_map_t mPolyMeshes;
|
||||
//avatar_joint_list_t mMeshLOD;
|
||||
virtual void dirtyMesh(S32 priority) = 0; // Dirty the avatar mesh, with priority
|
||||
|
||||
protected:
|
||||
typedef std::multimap<std::string, LLPolyMesh*> polymesh_map_t;
|
||||
polymesh_map_t mPolyMeshes;
|
||||
avatar_joint_list_t mMeshLOD;
|
||||
|
||||
/** Meshes
|
||||
** **
|
||||
@@ -258,24 +262,20 @@ protected:
|
||||
// Clothing colors (convenience functions to access visual parameters)
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
virtual void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color, BOOL upload_bake) = 0;
|
||||
virtual LLColor4 getClothesColor(LLAvatarAppearanceDefines::ETextureIndex te) = 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:
|
||||
virtual LLColor4 getGlobalColor(const std::string& color_name ) const = 0;
|
||||
LLColor4 getGlobalColor(const std::string& color_name ) const;
|
||||
virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake) = 0;
|
||||
|
||||
virtual S32 getNumCollisionVolumes() = 0;
|
||||
virtual LLAvatarJointCollisionVolume* getCollisionVolume(S32 i) = 0;
|
||||
|
||||
protected:
|
||||
//LLTexGlobalColor* mTexSkinColor;
|
||||
//LLTexGlobalColor* mTexHairColor;
|
||||
//LLTexGlobalColor* mTexEyeColor;
|
||||
LLTexGlobalColor* mTexSkinColor;
|
||||
LLTexGlobalColor* mTexHairColor;
|
||||
LLTexGlobalColor* mTexEyeColor;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Visibility
|
||||
@@ -295,7 +295,7 @@ public:
|
||||
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 = 0;
|
||||
virtual BOOL isWearingWearableType(LLWearableType::EType type ) const;
|
||||
|
||||
private:
|
||||
LLWearableData* mWearableData;
|
||||
@@ -305,13 +305,13 @@ private:
|
||||
** BAKED TEXTURES
|
||||
**/
|
||||
public:
|
||||
virtual LLTexLayerSet* getAvatarLayerSet(LLAvatarAppearanceDefines::EBakedTextureIndex baked_index) const = 0;
|
||||
LLTexLayerSet* getAvatarLayerSet(LLAvatarAppearanceDefines::EBakedTextureIndex baked_index) const;
|
||||
|
||||
protected:
|
||||
//virtual LLTexLayerSet* createTexLayerSet() = 0;
|
||||
virtual LLTexLayerSet* createTexLayerSet() = 0;
|
||||
|
||||
protected:
|
||||
/*class LLMaskedMorph;
|
||||
class LLMaskedMorph;
|
||||
typedef std::deque<LLMaskedMorph *> morph_list_t;
|
||||
struct BakedTextureData
|
||||
{
|
||||
@@ -326,7 +326,7 @@ protected:
|
||||
morph_list_t mMaskedMorphs;
|
||||
};
|
||||
typedef std::vector<BakedTextureData> bakedtexturedata_vec_t;
|
||||
bakedtexturedata_vec_t mBakedTextureDatas;*/
|
||||
bakedtexturedata_vec_t mBakedTextureDatas;
|
||||
|
||||
/********************************************************************************
|
||||
** **
|
||||
@@ -337,10 +337,10 @@ protected:
|
||||
// Collision volumes
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
//S32 mNumCollisionVolumes;
|
||||
//LLAvatarJointCollisionVolume* mCollisionVolumes;
|
||||
public:
|
||||
virtual BOOL allocateCollisionVolumes(U32 num) = 0;
|
||||
S32 mNumCollisionVolumes;
|
||||
LLAvatarJointCollisionVolume* mCollisionVolumes;
|
||||
protected:
|
||||
BOOL allocateCollisionVolumes(U32 num);
|
||||
|
||||
/** Physics
|
||||
** **
|
||||
@@ -351,7 +351,7 @@ public:
|
||||
** SUPPORT CLASSES
|
||||
**/
|
||||
|
||||
/*struct LLAvatarXmlInfo
|
||||
struct LLAvatarXmlInfo
|
||||
{
|
||||
LLAvatarXmlInfo();
|
||||
~LLAvatarXmlInfo();
|
||||
@@ -445,7 +445,7 @@ public:
|
||||
LLVisualParam *mMorphTarget;
|
||||
BOOL mInvert;
|
||||
std::string mLayer;
|
||||
};*/
|
||||
};
|
||||
/** Support Classes
|
||||
** **
|
||||
*******************************************************************************/
|
||||
|
||||
@@ -111,7 +111,7 @@ void LLDriverParamInfo::toStream(std::ostream &out)
|
||||
out << std::endl;
|
||||
|
||||
if(mDriverParam && mDriverParam->getAvatarAppearance()->isSelf() &&
|
||||
mDriverParam->getAvatarAppearance()->isAgent())
|
||||
mDriverParam->getAvatarAppearance()->isValid())
|
||||
{
|
||||
for (entry_info_list_t::iterator iter = mDrivenInfoList.begin(); iter != mDrivenInfoList.end(); iter++)
|
||||
{
|
||||
@@ -612,7 +612,7 @@ void LLDriverParam::setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight, bo
|
||||
{
|
||||
bool use_self = false;
|
||||
if(mWearablep &&
|
||||
mAvatarAppearance->isAgent() &&
|
||||
mAvatarAppearance->isValid() &&
|
||||
driven->mParam->getCrossWearable())
|
||||
{
|
||||
LLWearable* wearable = dynamic_cast<LLWearable*> (mWearablep);
|
||||
|
||||
@@ -640,13 +640,11 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
|
||||
for (iter = getInfo()->mVolumeInfoList.begin(); iter != getInfo()->mVolumeInfoList.end(); iter++)
|
||||
{
|
||||
LLPolyVolumeMorphInfo *volume_info = &(*iter);
|
||||
S32 volumes = avatarp->getNumCollisionVolumes();
|
||||
for (S32 i = 0; i < volumes; i++)
|
||||
for (S32 i = 0; i < avatarp->mNumCollisionVolumes; i++)
|
||||
{
|
||||
LLAvatarJointCollisionVolume* vol = avatarp->getCollisionVolume(i);
|
||||
if (vol->getName() == volume_info->mName)
|
||||
if (avatarp->mCollisionVolumes[i].getName() == volume_info->mName)
|
||||
{
|
||||
mVolumeMorphs.push_back(LLPolyVolumeMorph(vol,
|
||||
mVolumeMorphs.push_back(LLPolyVolumeMorph(&avatarp->mCollisionVolumes[i],
|
||||
volume_info->mScale,
|
||||
volume_info->mPos));
|
||||
break;
|
||||
|
||||
@@ -177,7 +177,7 @@ void LLTexLayerParamAlpha::setWeight(F32 weight, BOOL upload_bake)
|
||||
if ((mAvatarAppearance->getSex() & getSex()) &&
|
||||
(mAvatarAppearance->isSelf() && !mIsDummy)) // only trigger a baked texture update if we're changing a wearable's visual param.
|
||||
{
|
||||
if (mAvatarAppearance->isAgent() && !mAvatarAppearance->isUsingBakedTextures())
|
||||
if (mAvatarAppearance->isValid() && mAvatarAppearance->isEditingAppearance())
|
||||
{
|
||||
upload_bake = FALSE;
|
||||
}
|
||||
|
||||
@@ -1233,94 +1233,77 @@ BOOL LLPrimitive::packTEMessage(LLDataPacker &dp) const
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
S32 LLPrimitive::unpackTEMessage(LLMessageSystem* mesgsys, char const* block_name)
|
||||
S32 LLPrimitive::parseTEMessage(LLMessageSystem* mesgsys, char const* block_name, const S32 block_num, LLTEContents& tec)
|
||||
{
|
||||
return(unpackTEMessage(mesgsys,block_name,-1));
|
||||
}
|
||||
|
||||
S32 LLPrimitive::unpackTEMessage(LLMessageSystem* mesgsys, char const* block_name, const S32 block_num)
|
||||
{
|
||||
// use a negative block_num to indicate a single-block read (a non-variable block)
|
||||
S32 retval = 0;
|
||||
const U32 MAX_TES = 32;
|
||||
|
||||
// Avoid construction of 32 UUIDs per call. JC
|
||||
|
||||
U8 image_data[MAX_TES*16];
|
||||
U8 colors[MAX_TES*4];
|
||||
F32 scale_s[MAX_TES];
|
||||
F32 scale_t[MAX_TES];
|
||||
S16 offset_s[MAX_TES];
|
||||
S16 offset_t[MAX_TES];
|
||||
S16 image_rot[MAX_TES];
|
||||
U8 bump[MAX_TES];
|
||||
U8 media_flags[MAX_TES];
|
||||
U8 glow[MAX_TES];
|
||||
|
||||
const U32 MAX_TE_BUFFER = 4096;
|
||||
U8 packed_buffer[MAX_TE_BUFFER];
|
||||
U8 *cur_ptr = packed_buffer;
|
||||
|
||||
U32 size;
|
||||
U32 face_count = 0;
|
||||
|
||||
if (block_num < 0)
|
||||
{
|
||||
size = mesgsys->getSizeFast(block_name, _PREHASH_TextureEntry);
|
||||
tec.size = mesgsys->getSizeFast(block_name, _PREHASH_TextureEntry);
|
||||
}
|
||||
else
|
||||
{
|
||||
size = mesgsys->getSizeFast(block_name, block_num, _PREHASH_TextureEntry);
|
||||
tec.size = mesgsys->getSizeFast(block_name, block_num, _PREHASH_TextureEntry);
|
||||
}
|
||||
|
||||
if (size == 0)
|
||||
if (tec.size == 0)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
if (block_num < 0)
|
||||
{
|
||||
mesgsys->getBinaryDataFast(block_name, _PREHASH_TextureEntry, packed_buffer, 0, 0, MAX_TE_BUFFER);
|
||||
mesgsys->getBinaryDataFast(block_name, _PREHASH_TextureEntry, tec.packed_buffer, 0, 0, LLTEContents::MAX_TE_BUFFER);
|
||||
}
|
||||
else
|
||||
{
|
||||
mesgsys->getBinaryDataFast(block_name, _PREHASH_TextureEntry, packed_buffer, 0, block_num, MAX_TE_BUFFER);
|
||||
mesgsys->getBinaryDataFast(block_name, _PREHASH_TextureEntry, tec.packed_buffer, 0, block_num, LLTEContents::MAX_TE_BUFFER);
|
||||
}
|
||||
|
||||
face_count = getNumTEs();
|
||||
tec.face_count = getNumTEs();
|
||||
|
||||
cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)image_data, 16, face_count, MVT_LLUUID);
|
||||
U8 *cur_ptr = tec.packed_buffer;
|
||||
cur_ptr += unpackTEField(cur_ptr, tec.packed_buffer+tec.size, (U8 *)tec.image_data, 16, tec.face_count, MVT_LLUUID);
|
||||
cur_ptr++;
|
||||
cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)colors, 4, face_count, MVT_U8);
|
||||
cur_ptr += unpackTEField(cur_ptr, tec.packed_buffer+tec.size, (U8 *)tec.colors, 4, tec.face_count, MVT_U8);
|
||||
cur_ptr++;
|
||||
cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)scale_s, 4, face_count, MVT_F32);
|
||||
cur_ptr += unpackTEField(cur_ptr, tec.packed_buffer+tec.size, (U8 *)tec.scale_s, 4, tec.face_count, MVT_F32);
|
||||
cur_ptr++;
|
||||
cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)scale_t, 4, face_count, MVT_F32);
|
||||
cur_ptr += unpackTEField(cur_ptr, tec.packed_buffer+tec.size, (U8 *)tec.scale_t, 4, tec.face_count, MVT_F32);
|
||||
cur_ptr++;
|
||||
cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)offset_s, 2, face_count, MVT_S16Array);
|
||||
cur_ptr += unpackTEField(cur_ptr, tec.packed_buffer+tec.size, (U8 *)tec.offset_s, 2, tec.face_count, MVT_S16Array);
|
||||
cur_ptr++;
|
||||
cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)offset_t, 2, face_count, MVT_S16Array);
|
||||
cur_ptr += unpackTEField(cur_ptr, tec.packed_buffer+tec.size, (U8 *)tec.offset_t, 2, tec.face_count, MVT_S16Array);
|
||||
cur_ptr++;
|
||||
cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)image_rot, 2, face_count, MVT_S16Array);
|
||||
cur_ptr += unpackTEField(cur_ptr, tec.packed_buffer+tec.size, (U8 *)tec.image_rot, 2, tec.face_count, MVT_S16Array);
|
||||
cur_ptr++;
|
||||
cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)bump, 1, face_count, MVT_U8);
|
||||
cur_ptr += unpackTEField(cur_ptr, tec.packed_buffer+tec.size, (U8 *)tec.bump, 1, tec.face_count, MVT_U8);
|
||||
cur_ptr++;
|
||||
cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)media_flags, 1, face_count, MVT_U8);
|
||||
cur_ptr += unpackTEField(cur_ptr, tec.packed_buffer+tec.size, (U8 *)tec.media_flags, 1, tec.face_count, MVT_U8);
|
||||
cur_ptr++;
|
||||
cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)glow, 1, face_count, MVT_U8);
|
||||
|
||||
cur_ptr += unpackTEField(cur_ptr, tec.packed_buffer+tec.size, (U8 *)tec.glow, 1, tec.face_count, MVT_U8);
|
||||
|
||||
retval = 1;
|
||||
return retval;
|
||||
}
|
||||
|
||||
S32 LLPrimitive::applyParsedTEMessage(LLTEContents& tec)
|
||||
{
|
||||
S32 retval = 0;
|
||||
|
||||
LLColor4 color;
|
||||
LLColor4U coloru;
|
||||
for (U32 i = 0; i < face_count; i++)
|
||||
for (U32 i = 0; i < tec.face_count; i++)
|
||||
{
|
||||
retval |= setTETexture(i, ((LLUUID*)image_data)[i]);
|
||||
retval |= setTEScale(i, scale_s[i], scale_t[i]);
|
||||
retval |= setTEOffset(i, (F32)offset_s[i] / (F32)0x7FFF, (F32) offset_t[i] / (F32) 0x7FFF);
|
||||
retval |= setTERotation(i, ((F32)image_rot[i] / TEXTURE_ROTATION_PACK_FACTOR) * F_TWO_PI);
|
||||
retval |= setTEBumpShinyFullbright(i, bump[i]);
|
||||
retval |= setTEMediaTexGen(i, media_flags[i]);
|
||||
retval |= setTEGlow(i, (F32)glow[i] / (F32)0xFF);
|
||||
coloru = LLColor4U(colors + 4*i);
|
||||
LLUUID& req_id = ((LLUUID*)tec.image_data)[i];
|
||||
retval |= setTETexture(i, req_id);
|
||||
retval |= setTEScale(i, tec.scale_s[i], tec.scale_t[i]);
|
||||
retval |= setTEOffset(i, (F32)tec.offset_s[i] / (F32)0x7FFF, (F32) tec.offset_t[i] / (F32) 0x7FFF);
|
||||
retval |= setTERotation(i, ((F32)tec.image_rot[i] / TEXTURE_ROTATION_PACK_FACTOR) * F_TWO_PI);
|
||||
retval |= setTEBumpShinyFullbright(i, tec.bump[i]);
|
||||
retval |= setTEMediaTexGen(i, tec.media_flags[i]);
|
||||
retval |= setTEGlow(i, (F32)tec.glow[i] / (F32)0xFF);
|
||||
coloru = LLColor4U(tec.colors + 4*i);
|
||||
|
||||
// Note: This is an optimization to send common colors (1.f, 1.f, 1.f, 1.f)
|
||||
// as all zeros. However, the subtraction and addition must be done in unsigned
|
||||
@@ -1337,6 +1320,15 @@ S32 LLPrimitive::unpackTEMessage(LLMessageSystem* mesgsys, char const* block_nam
|
||||
return retval;
|
||||
}
|
||||
|
||||
S32 LLPrimitive::unpackTEMessage(LLMessageSystem* mesgsys, char const* block_name, const S32 block_num)
|
||||
{
|
||||
LLTEContents tec;
|
||||
S32 retval = parseTEMessage(mesgsys, block_name, block_num, tec);
|
||||
if (!retval)
|
||||
return retval;
|
||||
return applyParsedTEMessage(tec);
|
||||
}
|
||||
|
||||
S32 LLPrimitive::unpackTEMessage(LLDataPacker &dp)
|
||||
{
|
||||
// use a negative block_num to indicate a single-block read (a non-variable block)
|
||||
|
||||
@@ -295,6 +295,34 @@ public:
|
||||
};
|
||||
|
||||
|
||||
// This code is not naming-standards compliant. Leaving it like this for
|
||||
// now to make the connection to code in
|
||||
// BOOL packTEMessage(LLDataPacker &dp) const;
|
||||
// more obvious. This should be refactored to remove the duplication, at which
|
||||
// point we can fix the names as well.
|
||||
// - Vir
|
||||
struct LLTEContents
|
||||
{
|
||||
static const U32 MAX_TES = 32;
|
||||
|
||||
U8 image_data[MAX_TES*16];
|
||||
U8 colors[MAX_TES*4];
|
||||
F32 scale_s[MAX_TES];
|
||||
F32 scale_t[MAX_TES];
|
||||
S16 offset_s[MAX_TES];
|
||||
S16 offset_t[MAX_TES];
|
||||
S16 image_rot[MAX_TES];
|
||||
U8 bump[MAX_TES];
|
||||
U8 media_flags[MAX_TES];
|
||||
U8 glow[MAX_TES];
|
||||
|
||||
static const U32 MAX_TE_BUFFER = 4096;
|
||||
U8 packed_buffer[MAX_TE_BUFFER];
|
||||
|
||||
U32 size;
|
||||
U32 face_count;
|
||||
};
|
||||
|
||||
class LLPrimitive : public LLXform
|
||||
{
|
||||
public:
|
||||
@@ -366,9 +394,10 @@ public:
|
||||
S32 unpackTEField(U8 *cur_ptr, U8 *buffer_end, U8 *data_ptr, U8 data_size, U8 face_count, EMsgVariableType type);
|
||||
BOOL packTEMessage(LLMessageSystem *mesgsys) const;
|
||||
BOOL packTEMessage(LLDataPacker &dp) const;
|
||||
S32 unpackTEMessage(LLMessageSystem* mesgsys, char const* block_name);
|
||||
S32 unpackTEMessage(LLMessageSystem* mesgsys, char const* block_name, const S32 block_num); // Variable num of blocks
|
||||
BOOL unpackTEMessage(LLDataPacker &dp);
|
||||
S32 parseTEMessage(LLMessageSystem* mesgsys, char const* block_name, const S32 block_num, LLTEContents& tec);
|
||||
S32 applyParsedTEMessage(LLTEContents& tec);
|
||||
|
||||
#ifdef CHECK_FOR_FINITE
|
||||
inline void setPosition(const LLVector3& pos);
|
||||
|
||||
@@ -3336,7 +3336,7 @@ void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void *
|
||||
return;
|
||||
}
|
||||
|
||||
if (isAgentAvatarValid() && !gAgentAvatarp->isUsingBakedTextures())
|
||||
if (isAgentAvatarValid() && gAgentAvatarp->isEditingAppearance())
|
||||
{
|
||||
// ignore baked textures when in customize mode
|
||||
return;
|
||||
@@ -3912,7 +3912,7 @@ void LLAgent::sendAgentSetAppearance()
|
||||
{
|
||||
if (!isAgentAvatarValid()) return;
|
||||
|
||||
if (gAgentQueryManager.mNumPendingQueries > 0 && (isAgentAvatarValid() && gAgentAvatarp->isUsingBakedTextures()))
|
||||
if (gAgentQueryManager.mNumPendingQueries > 0 && (isAgentAvatarValid() && !gAgentAvatarp->isEditingAppearance()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1586,6 +1586,8 @@ bool LLAppViewer::cleanup()
|
||||
|
||||
LLViewerObject::cleanupVOClasses();
|
||||
|
||||
LLAvatarAppearance::cleanupClass();
|
||||
|
||||
LLPostProcess::cleanupClass();
|
||||
|
||||
LLTracker::cleanupInstance();
|
||||
|
||||
@@ -1684,9 +1684,13 @@ bool idle_startup()
|
||||
display_startup();
|
||||
|
||||
// init the shader managers
|
||||
//LLDayCycleManager::initClass();
|
||||
|
||||
LLAvatarAppearance::initClass();
|
||||
display_startup();
|
||||
|
||||
//LLDayCycleManager::initClass();
|
||||
//display_startup();
|
||||
|
||||
// RN: don't initialize VO classes in drone mode, they are too closely tied to rendering
|
||||
LLViewerObject::initVOClasses();
|
||||
display_startup();
|
||||
|
||||
@@ -241,7 +241,7 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy)
|
||||
// setup current color
|
||||
//----------------------------------------------------------------
|
||||
if (is_dummy)
|
||||
gGL.diffuseColor4fv(LLAvatarAppearance::getDummyColor().mV);
|
||||
gGL.diffuseColor4fv(LLVOAvatar::getDummyColor().mV);
|
||||
else
|
||||
gGL.diffuseColor4fv(mColor.mV);
|
||||
|
||||
|
||||
@@ -8389,18 +8389,18 @@ void init_meshes_and_morphs_menu()
|
||||
menu->addChild(new LLMenuItemCallGL("Dump Avatar Mesh Info", &LLPolyMesh::dumpDiagInfo));
|
||||
menu->addSeparator();
|
||||
|
||||
LLVOAvatar::mesh_info_t mesh_info;
|
||||
LLVOAvatar::getMeshInfo(&mesh_info);
|
||||
LLAvatarAppearance::mesh_info_t mesh_info;
|
||||
LLAvatarAppearance::getMeshInfo(&mesh_info);
|
||||
|
||||
for(LLVOAvatarSelf::mesh_info_t::iterator info_iter = mesh_info.begin();
|
||||
for(LLAvatarAppearance::mesh_info_t::iterator info_iter = mesh_info.begin();
|
||||
info_iter != mesh_info.end(); ++info_iter)
|
||||
{
|
||||
const std::string& type = info_iter->first;
|
||||
LLVOAvatar::lod_mesh_map_t& lod_mesh = info_iter->second;
|
||||
LLAvatarAppearance::lod_mesh_map_t& lod_mesh = info_iter->second;
|
||||
|
||||
LLMenuGL* type_menu = new LLMenuGL(type);
|
||||
|
||||
for(LLVOAvatar::lod_mesh_map_t::iterator lod_iter = lod_mesh.begin();
|
||||
for(LLAvatarAppearance::lod_mesh_map_t::iterator lod_iter = lod_mesh.begin();
|
||||
lod_iter != lod_mesh.end(); ++lod_iter)
|
||||
{
|
||||
S32 lod = lod_iter->first;
|
||||
|
||||
@@ -288,7 +288,7 @@ BOOL LLViewerTexLayerSetBuffer::uploadInProgress() const
|
||||
BOOL LLViewerTexLayerSetBuffer::isReadyToUpload() const
|
||||
{
|
||||
if (!gAgentQueryManager.hasNoPendingQueries()) return FALSE; // Can't upload if there are pending queries.
|
||||
if (isAgentAvatarValid() && !gAgentAvatarp->isUsingBakedTextures()) return FALSE; // Don't upload if avatar is using composites.
|
||||
if (isAgentAvatarValid() && gAgentAvatarp->isEditingAppearance()) return FALSE; // Don't upload if avatar is being edited.
|
||||
|
||||
BOOL ready = FALSE;
|
||||
if (getViewerTexLayerSet()->isLocalTextureDataFinal())
|
||||
|
||||
@@ -320,7 +320,7 @@ void LLViewerWearable::writeToAvatar(LLAvatarAppearance *avatarp)
|
||||
|
||||
if (!avatarp || !viewer_avatar) return;
|
||||
|
||||
if (!viewer_avatar->isAgent()) return;
|
||||
if (!viewer_avatar->isValid()) return;
|
||||
|
||||
ESex old_sex = avatarp->getSex();
|
||||
|
||||
|
||||
@@ -4904,7 +4904,7 @@ void LLViewerWindow::restoreGL(const std::string& progress_message)
|
||||
gResizeScreenTexture = TRUE;
|
||||
gWindowResized = TRUE;
|
||||
|
||||
if (isAgentAvatarValid() && !gAgentAvatarp->isUsingBakedTextures())
|
||||
if (isAgentAvatarValid() && gAgentAvatarp->isEditingAppearance())
|
||||
{
|
||||
LLVisualParamHint::requestHintUpdates();
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -66,15 +66,12 @@ extern const LLUUID ANIM_AGENT_PELVIS_FIX;
|
||||
extern const LLUUID ANIM_AGENT_TARGET;
|
||||
extern const LLUUID ANIM_AGENT_WALK_ADJUST;
|
||||
|
||||
class LLTexLayerSet;
|
||||
class LLViewerWearable;
|
||||
class LLVoiceVisualizer;
|
||||
class LLHUDNameTag;
|
||||
class LLHUDEffectSpiral;
|
||||
class LLTexGlobalColor;
|
||||
class LLVOAvatarBoneInfo;
|
||||
class LLAvatarSkeletonInfo;
|
||||
class LLPolySkeletalDistortionInfo;
|
||||
class LLViewerWearable;
|
||||
class LLViewerJoint;
|
||||
|
||||
class SHClientTagMgr : public LLSingleton<SHClientTagMgr>, public boost::signals2::trackable
|
||||
{
|
||||
@@ -128,9 +125,6 @@ class LLVOAvatar :
|
||||
|
||||
public:
|
||||
friend class LLVOAvatarSelf;
|
||||
protected:
|
||||
struct LLVOAvatarXmlInfo;
|
||||
class LLMaskedMorph;
|
||||
|
||||
/********************************************************************************
|
||||
** **
|
||||
@@ -155,18 +149,11 @@ public:
|
||||
virtual void initInstance(); // Called after construction to initialize the class.
|
||||
protected:
|
||||
virtual ~LLVOAvatar();
|
||||
BOOL loadSkeletonNode();
|
||||
BOOL loadMeshNodes();
|
||||
virtual BOOL loadLayersets();
|
||||
|
||||
/** Initialization
|
||||
** **
|
||||
*******************************************************************************/
|
||||
|
||||
public:
|
||||
/*virtual*/ bool isAgent() const;
|
||||
|
||||
|
||||
/********************************************************************************
|
||||
** **
|
||||
** INHERITED
|
||||
@@ -176,31 +163,31 @@ public:
|
||||
// LLViewerObject interface and related
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
virtual void updateGL();
|
||||
virtual LLVOAvatar* asAvatar();
|
||||
/*virtual*/ void updateGL();
|
||||
/*virtual*/ LLVOAvatar* asAvatar();
|
||||
virtual U32 processUpdateMessage(LLMessageSystem *mesgsys,
|
||||
void **user_data,
|
||||
U32 block_num,
|
||||
const EObjectUpdateType update_type,
|
||||
LLDataPacker *dp);
|
||||
virtual void idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time);
|
||||
virtual BOOL updateLOD();
|
||||
/*virtual*/ BOOL updateLOD();
|
||||
BOOL updateJointLODs();
|
||||
void updateLODRiggedAttachments( void );
|
||||
virtual BOOL isActive() const; // Whether this object needs to do an idleUpdate.
|
||||
virtual void updateTextures();
|
||||
virtual S32 setTETexture(const U8 te, const LLUUID& uuid); // If setting a baked texture, need to request it from a non-local sim.
|
||||
virtual void onShift(const LLVector4a& shift_vector);
|
||||
virtual U32 getPartitionType() const;
|
||||
virtual const LLVector3 getRenderPosition() const;
|
||||
virtual void updateDrawable(BOOL force_damped);
|
||||
virtual LLDrawable* createDrawable(LLPipeline *pipeline);
|
||||
virtual BOOL updateGeometry(LLDrawable *drawable);
|
||||
virtual void setPixelAreaAndAngle(LLAgent &agent);
|
||||
virtual void updateRegion(LLViewerRegion *regionp);
|
||||
virtual void updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax);
|
||||
virtual void getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax);
|
||||
virtual BOOL lineSegmentIntersect(const LLVector3& start, const LLVector3& end,
|
||||
/*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate.
|
||||
/*virtual*/ void updateTextures();
|
||||
/*virtual*/ S32 setTETexture(const U8 te, const LLUUID& uuid); // If setting a baked texture, need to request it from a non-local sim.
|
||||
/*virtual*/ void onShift(const LLVector4a& shift_vector);
|
||||
/*virtual*/ U32 getPartitionType() const;
|
||||
/*virtual*/ const LLVector3 getRenderPosition() const;
|
||||
/*virtual*/ void updateDrawable(BOOL force_damped);
|
||||
/*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline);
|
||||
/*virtual*/ BOOL updateGeometry(LLDrawable *drawable);
|
||||
/*virtual*/ void setPixelAreaAndAngle(LLAgent &agent);
|
||||
/*virtual*/ void updateRegion(LLViewerRegion *regionp);
|
||||
/*virtual*/ void updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax);
|
||||
/*virtual*/ void getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax);
|
||||
/*virtual*/ BOOL lineSegmentIntersect(const LLVector3& start, const LLVector3& end,
|
||||
S32 face = -1, // which face to check, -1 = ALL_SIDES
|
||||
BOOL pick_transparent = FALSE,
|
||||
S32* face_hit = NULL, // which face was hit
|
||||
@@ -221,16 +208,14 @@ public:
|
||||
// LLCharacter interface and related
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
virtual LLVector3 getCharacterPosition();
|
||||
virtual LLQuaternion getCharacterRotation();
|
||||
virtual LLVector3 getCharacterVelocity();
|
||||
virtual LLVector3 getCharacterAngularVelocity();
|
||||
virtual LLJoint* getCharacterJoint(U32 num);
|
||||
virtual BOOL allocateCharacterJoints(U32 num);
|
||||
/*virtual*/ LLVector3 getCharacterPosition();
|
||||
/*virtual*/ LLQuaternion getCharacterRotation();
|
||||
/*virtual*/ LLVector3 getCharacterVelocity();
|
||||
/*virtual*/ LLVector3 getCharacterAngularVelocity();
|
||||
|
||||
virtual LLUUID remapMotionID(const LLUUID& id);
|
||||
virtual BOOL startMotion(const LLUUID& id, F32 time_offset = 0.f);
|
||||
virtual BOOL stopMotion(const LLUUID& id, BOOL stop_immediate = FALSE);
|
||||
/*virtual*/ LLUUID remapMotionID(const LLUUID& id);
|
||||
/*virtual*/ BOOL startMotion(const LLUUID& id, F32 time_offset = 0.f);
|
||||
/*virtual*/ BOOL stopMotion(const LLUUID& id, BOOL stop_immediate = FALSE);
|
||||
virtual void stopMotionFromSource(const LLUUID& source_id);
|
||||
virtual void requestStopMotion(LLMotion* motion);
|
||||
LLMotion* findMotion(const LLUUID& id) const;
|
||||
@@ -238,22 +223,17 @@ public:
|
||||
void dumpAnimationState();
|
||||
|
||||
virtual LLJoint* getJoint(const std::string &name);
|
||||
virtual LLJoint* getRootJoint() { return mRoot; }
|
||||
|
||||
|
||||
void resetJointPositionsToDefault( void );
|
||||
void resetSpecificJointPosition( const std::string& name );
|
||||
virtual const LLUUID& getID() const;
|
||||
virtual LLVector3 getVolumePos(S32 joint_index, LLVector3& volume_offset);
|
||||
virtual LLJoint* findCollisionVolume(U32 volume_id);
|
||||
virtual S32 getCollisionVolumeID(std::string &name);
|
||||
virtual void addDebugText(const std::string& text);
|
||||
virtual F32 getTimeDilation();
|
||||
virtual void getGround(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm);
|
||||
virtual F32 getPixelArea() const;
|
||||
virtual LLPolyMesh* getHeadMesh();
|
||||
virtual LLPolyMesh* getUpperBodyMesh();
|
||||
virtual LLVector3d getPosGlobalFromAgent(const LLVector3 &position);
|
||||
virtual LLVector3 getPosAgentFromGlobal(const LLVector3d &position);
|
||||
|
||||
/*virtual*/ const LLUUID& getID() const;
|
||||
/*virtual*/ void addDebugText(const std::string& text);
|
||||
/*virtual*/ F32 getTimeDilation();
|
||||
/*virtual*/ void getGround(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm);
|
||||
/*virtual*/ F32 getPixelArea() const;
|
||||
/*virtual*/ LLVector3d getPosGlobalFromAgent(const LLVector3 &position);
|
||||
/*virtual*/ LLVector3 getPosAgentFromGlobal(const LLVector3d &position);
|
||||
virtual void updateVisualParams();
|
||||
|
||||
|
||||
@@ -268,7 +248,6 @@ public:
|
||||
|
||||
public:
|
||||
virtual bool isSelf() const { return false; } // True if this avatar is for this viewer's agent
|
||||
virtual bool isBuilt() const { return mIsBuilt; }
|
||||
|
||||
private: //aligned members
|
||||
LL_ALIGN_16(LLVector4a mImpostorExtents[2]);
|
||||
@@ -300,9 +279,7 @@ public:
|
||||
void idleUpdateRenderCost();
|
||||
void idleUpdateBelowWater();
|
||||
void idleUpdateBoobEffect(); //Emerald
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Static preferences (controlled by user settings/menus)
|
||||
//--------------------------------------------------------------------
|
||||
@@ -335,7 +312,7 @@ public:
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
BOOL isFullyLoaded() const;
|
||||
bool visualParamWeightsAreDefault();
|
||||
bool visualParamWeightsAreDefault();
|
||||
virtual BOOL getIsCloud() const;
|
||||
BOOL isFullyTextured() const;
|
||||
BOOL hasGray() const;
|
||||
@@ -346,7 +323,6 @@ public:
|
||||
protected:
|
||||
BOOL updateIsFullyLoaded();
|
||||
BOOL processFullyLoadedChange(bool loading);
|
||||
|
||||
void updateRuthTimer(bool loading);
|
||||
F32 calcMorphAmount();
|
||||
private:
|
||||
@@ -364,85 +340,33 @@ protected:
|
||||
/** State
|
||||
** **
|
||||
*******************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
** **
|
||||
** SKELETON
|
||||
**/
|
||||
|
||||
virtual LLAvatarJoint* createAvatarJoint();
|
||||
virtual LLAvatarJoint* createAvatarJoint(S32 joint_num);
|
||||
virtual LLAvatarJointMesh* createAvatarJointMesh();
|
||||
protected:
|
||||
/*virtual*/ LLAvatarJoint* createAvatarJoint(); // Returns LLViewerJoint
|
||||
/*virtual*/ LLAvatarJoint* createAvatarJoint(S32 joint_num); // Returns LLViewerJoint
|
||||
/*virtual*/ LLAvatarJointMesh* createAvatarJointMesh(); // Returns LLViewerJointMesh
|
||||
public:
|
||||
void updateHeadOffset();
|
||||
virtual F32 getPelvisToFoot() const { return mPelvisToFoot; }
|
||||
void setPelvisOffset( bool hasOffset, const LLVector3& translation, F32 offset ) ;
|
||||
bool hasPelvisOffset( void ) { return mHasPelvisOffset; }
|
||||
void postPelvisSetRecalc( void );
|
||||
void setPelvisOffset( F32 pelvixFixupAmount );
|
||||
|
||||
/*virtual*/ BOOL loadSkeletonNode();
|
||||
/*virtual*/ void buildCharacter();
|
||||
|
||||
bool mHasPelvisOffset;
|
||||
LLVector3 mPelvisOffset;
|
||||
F32 mLastPelvisToFoot;
|
||||
F32 mPelvisFixup;
|
||||
F32 mLastPelvisFixup;
|
||||
|
||||
LLVector3 mHeadOffset; // current head position
|
||||
LLAvatarJoint *mRoot;
|
||||
|
||||
typedef std::map<std::string, LLJoint*> joint_map_t;
|
||||
joint_map_t mJointMap;
|
||||
|
||||
public:
|
||||
static BOOL parseSkeletonFile(const std::string& filename);
|
||||
virtual void buildCharacter();
|
||||
virtual BOOL loadAvatar();
|
||||
|
||||
BOOL setupBone(const LLVOAvatarBoneInfo* info, LLJoint* parent, S32 ¤t_volume_num, S32 ¤t_joint_num);
|
||||
virtual BOOL buildSkeleton(const LLAvatarSkeletonInfo *info);
|
||||
private:
|
||||
BOOL mIsBuilt; // state of deferred character building
|
||||
typedef std::vector<LLAvatarJoint*> avatar_joint_list_t;
|
||||
avatar_joint_list_t mSkeleton;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Pelvis height adjustment members.
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
LLVector3 mBodySize;
|
||||
S32 mLastSkeletonSerialNum;
|
||||
private:
|
||||
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
|
||||
//--------------------------------------------------------------------
|
||||
private:
|
||||
static LLXmlTree sXMLTree; // avatar config file
|
||||
static LLXmlTree sSkeletonXMLTree; // avatar skeleton file
|
||||
|
||||
/** Skeleton
|
||||
** **
|
||||
@@ -483,9 +407,15 @@ private:
|
||||
// Morph masks
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
/*virtual*/ void applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLAvatarAppearanceDefines::EBakedTextureIndex index = LLAvatarAppearanceDefines::BAKED_NUM_INDICES);
|
||||
BOOL morphMaskNeedsUpdate(LLAvatarAppearanceDefines::EBakedTextureIndex index = LLAvatarAppearanceDefines::BAKED_NUM_INDICES);
|
||||
virtual void addMaskedMorph(LLAvatarAppearanceDefines::EBakedTextureIndex index, LLVisualParam* morph_target, BOOL invert, std::string layer);
|
||||
void applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components, LLAvatarAppearanceDefines::EBakedTextureIndex index = LLAvatarAppearanceDefines::BAKED_NUM_INDICES);
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Global colors
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
/*virtual*/void onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake);
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Visibility
|
||||
@@ -571,7 +501,7 @@ public:
|
||||
virtual LLViewerTexture::EBoostLevel getAvatarBoostLevel() const { return LLGLTexture::BOOST_AVATAR; }
|
||||
virtual LLViewerTexture::EBoostLevel getAvatarBakedBoostLevel() const { return LLGLTexture::BOOST_AVATAR_BAKED; }
|
||||
virtual S32 getTexImageSize() const;
|
||||
virtual S32 getTexImageArea() const { return getTexImageSize()*getTexImageSize(); }
|
||||
/*virtual*/ S32 getTexImageArea() const { return getTexImageSize()*getTexImageSize(); }
|
||||
|
||||
/** Rendering
|
||||
** **
|
||||
@@ -599,6 +529,7 @@ public:
|
||||
// Baked textures
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
/*virtual*/ LLTexLayerSet* createTexLayerSet(); // Return LLViewerTexLayerSet
|
||||
void releaseComponentTextures(); // ! BACKWARDS COMPATIBILITY !
|
||||
protected:
|
||||
static void onBakedTextureMasksLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
|
||||
@@ -608,23 +539,7 @@ protected:
|
||||
void useBakedTexture(const LLUUID& id);
|
||||
LLViewerTexLayerSet* getTexLayerSet(const U32 index) const { return dynamic_cast<LLViewerTexLayerSet*>(mBakedTextureDatas[index].mTexLayerSet); }
|
||||
|
||||
LLTexLayerSet* createTexLayerSet();
|
||||
|
||||
typedef std::deque<LLMaskedMorph *> morph_list_t;
|
||||
struct BakedTextureData
|
||||
{
|
||||
LLUUID mLastTextureID;
|
||||
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
|
||||
avatar_joint_mesh_list_t mJointMeshes; // std::vector<LLAvatarJointMesh> mJoints[i]->mMeshParts
|
||||
morph_list_t mMaskedMorphs;
|
||||
};
|
||||
typedef std::vector<BakedTextureData> bakedtexturedata_vec_t;
|
||||
bakedtexturedata_vec_t mBakedTextureDatas;
|
||||
|
||||
LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList ;
|
||||
BOOL mLoadedCallbacksPaused;
|
||||
//--------------------------------------------------------------------
|
||||
@@ -673,8 +588,6 @@ public:
|
||||
private:
|
||||
static const LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary *getDictionary() { return sAvatarDictionary; }
|
||||
static LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary* sAvatarDictionary;
|
||||
static LLAvatarSkeletonInfo* sAvatarSkeletonInfo;
|
||||
static LLVOAvatarXmlInfo* sAvatarXmlInfo;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Messaging
|
||||
@@ -695,23 +608,19 @@ private:
|
||||
**/
|
||||
|
||||
public:
|
||||
virtual void updateMeshTextures();
|
||||
virtual void updateMeshTextures();
|
||||
void updateSexDependentLayerSets(BOOL upload_bake);
|
||||
virtual void dirtyMesh(); // Dirty the avatar mesh
|
||||
virtual void dirtyMesh(); // Dirty the avatar mesh
|
||||
void updateMeshData();
|
||||
protected:
|
||||
void releaseMeshData();
|
||||
virtual void restoreMeshData();
|
||||
virtual void restoreMeshData();
|
||||
private:
|
||||
virtual void dirtyMesh(S32 priority); // Dirty the avatar mesh, with priority
|
||||
virtual void dirtyMesh(S32 priority); // Dirty the avatar mesh, with priority
|
||||
LLViewerJoint* getViewerJoint(S32 idx);
|
||||
S32 mDirtyMesh; // 0 -- not dirty, 1 -- morphed, 2 -- LOD
|
||||
BOOL mMeshTexturesDirty;
|
||||
|
||||
typedef std::multimap<std::string, LLPolyMesh*> polymesh_map_t;
|
||||
polymesh_map_t mPolyMeshes;
|
||||
avatar_joint_list_t mMeshLOD;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Destroy invisible mesh
|
||||
//--------------------------------------------------------------------
|
||||
@@ -732,7 +641,7 @@ public:
|
||||
void processAvatarAppearance(LLMessageSystem* mesgsys);
|
||||
void hideSkirt();
|
||||
void startAppearanceAnimation();
|
||||
virtual LLPolyMesh* getMesh(LLPolyMeshSharedData* shared_data);
|
||||
/*virtual*/ void bodySizeChanged();
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Appearance morphing
|
||||
@@ -744,30 +653,6 @@ private:
|
||||
LLFrameTimer mAppearanceMorphTimer;
|
||||
F32 mLastAppearanceBlendTime;
|
||||
|
||||
public:
|
||||
typedef std::map<S32, std::string> lod_mesh_map_t;
|
||||
typedef std::map<std::string, lod_mesh_map_t> mesh_info_t;
|
||||
|
||||
static void getMeshInfo(mesh_info_t* mesh_info);
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Clothing colors (convenience functions to access visual parameters)
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
virtual void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color, BOOL upload_bake);
|
||||
virtual LLColor4 getClothesColor(LLAvatarAppearanceDefines::ETextureIndex te);
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Global colors
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
virtual LLColor4 getGlobalColor(const std::string& color_name ) const;
|
||||
virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake);
|
||||
private:
|
||||
LLTexGlobalColor* mTexSkinColor;
|
||||
LLTexGlobalColor* mTexHairColor;
|
||||
LLTexGlobalColor* mTexEyeColor;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Visibility
|
||||
//--------------------------------------------------------------------
|
||||
@@ -785,8 +670,6 @@ public:
|
||||
** WEARABLES
|
||||
**/
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Attachments
|
||||
//--------------------------------------------------------------------
|
||||
@@ -796,8 +679,7 @@ public:
|
||||
virtual BOOL detachObject(LLViewerObject *viewer_object);
|
||||
void cleanupAttachedMesh( LLViewerObject* pVO );
|
||||
static LLVOAvatar* findAvatarFromAttachment(LLViewerObject* obj);
|
||||
virtual BOOL isWearingWearableType(LLWearableType::EType type ) const;
|
||||
virtual LLTexLayerSet* getAvatarLayerSet(LLAvatarAppearanceDefines::EBakedTextureIndex baked_index) const;
|
||||
/*virtual*/ BOOL isWearingWearableType(LLWearableType::EType type ) const;
|
||||
protected:
|
||||
LLViewerJointAttachment* getTargetAttachmentPoint(LLViewerObject* viewer_object);
|
||||
void lazyAttach();
|
||||
@@ -810,7 +692,7 @@ public:
|
||||
S32 getAttachmentCount(); // Warning: order(N) not order(1) // currently used only by -self
|
||||
typedef std::map<S32, LLViewerJointAttachment*> attachment_map_t;
|
||||
attachment_map_t mAttachmentPoints;
|
||||
std::vector<LLPointer<LLViewerObject> > mPendingAttachment;
|
||||
std::vector<LLPointer<LLViewerObject> > mPendingAttachment;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// HUD functions
|
||||
@@ -915,18 +797,6 @@ private:
|
||||
BOOL mTurning; // controls hysteresis on avatar rotation
|
||||
F32 mSpeed; // misc. animation repeated state
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Collision volumes
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
S32 mNumCollisionVolumes;
|
||||
LLAvatarJointCollisionVolume* mCollisionVolumes;
|
||||
virtual S32 getNumCollisionVolumes() { return mNumCollisionVolumes; }
|
||||
virtual LLAvatarJointCollisionVolume* getCollisionVolume(S32 i) { return &mCollisionVolumes[i]; }
|
||||
|
||||
protected:
|
||||
virtual BOOL allocateCollisionVolumes(U32 num);
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Dimensions
|
||||
//--------------------------------------------------------------------
|
||||
@@ -936,7 +806,6 @@ public:
|
||||
void resolveRayCollisionAgent(const LLVector3d start_pt, const LLVector3d end_pt, LLVector3d &out_pos, LLVector3 &out_norm);
|
||||
void slamPosition(); // Slam position to transmitted position (for teleport);
|
||||
protected:
|
||||
virtual void computeBodySize();
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Material being stepped on
|
||||
@@ -980,9 +849,9 @@ private:
|
||||
**/
|
||||
|
||||
public:
|
||||
virtual BOOL setParent(LLViewerObject* parent);
|
||||
virtual void addChild(LLViewerObject *childp);
|
||||
virtual void removeChild(LLViewerObject *childp);
|
||||
/*virtual*/ BOOL setParent(LLViewerObject* parent);
|
||||
/*virtual*/ void addChild(LLViewerObject *childp);
|
||||
/*virtual*/ void removeChild(LLViewerObject *childp);
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Sitting
|
||||
@@ -1006,7 +875,7 @@ private:
|
||||
**/
|
||||
|
||||
public:
|
||||
std::string getFullname() const; // Returns "FirstName LastName"
|
||||
/*virtual*/ std::string getFullname() const; // Returns "FirstName LastName"
|
||||
std::string avString() const; // Frequently used string in log messages "Avatar '<full name'"
|
||||
protected:
|
||||
static void getAnimLabels(LLDynamicArray<std::string>* labels);
|
||||
@@ -1129,101 +998,6 @@ protected:
|
||||
|
||||
protected: // Shared with LLVOAvatarSelf
|
||||
|
||||
struct LLVOAvatarXmlInfo
|
||||
{
|
||||
LLVOAvatarXmlInfo();
|
||||
~LLVOAvatarXmlInfo();
|
||||
|
||||
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 LLVOAvatarMeshInfo
|
||||
{
|
||||
typedef std::pair<LLViewerVisualParamInfo*,BOOL> morph_info_pair_t;
|
||||
typedef std::vector<morph_info_pair_t> morph_info_list_t;
|
||||
|
||||
LLVOAvatarMeshInfo() : mLOD(0), mMinPixelArea(.1f) {}
|
||||
~LLVOAvatarMeshInfo()
|
||||
{
|
||||
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<LLVOAvatarMeshInfo*> mesh_info_list_t;
|
||||
mesh_info_list_t mMeshInfoList;
|
||||
|
||||
typedef std::vector<LLViewerVisualParamInfo*> skeletal_distortion_info_list_t;
|
||||
skeletal_distortion_info_list_t mSkeletalDistortionInfoList;
|
||||
|
||||
struct LLVOAvatarAttachmentInfo
|
||||
{
|
||||
LLVOAvatarAttachmentInfo()
|
||||
: 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<LLVOAvatarAttachmentInfo*> attachment_info_list_t;
|
||||
attachment_info_list_t mAttachmentInfoList;
|
||||
|
||||
LLTexGlobalColorInfo *mTexSkinColorInfo;
|
||||
LLTexGlobalColorInfo *mTexHairColorInfo;
|
||||
LLTexGlobalColorInfo *mTexEyeColorInfo;
|
||||
|
||||
typedef std::vector<LLTexLayerSetInfo*> layer_info_list_t;
|
||||
layer_info_list_t mLayerInfoList;
|
||||
|
||||
typedef std::vector<LLDriverParamInfo*> driver_info_list_t;
|
||||
driver_info_list_t mDriverInfoList;
|
||||
|
||||
struct LLVOAvatarMorphInfo
|
||||
{
|
||||
LLVOAvatarMorphInfo()
|
||||
: mInvert(FALSE) {}
|
||||
std::string mName;
|
||||
std::string mRegion;
|
||||
std::string mLayer;
|
||||
BOOL mInvert;
|
||||
};
|
||||
|
||||
typedef std::vector<LLVOAvatarMorphInfo*> morph_info_list_t;
|
||||
morph_info_list_t mMorphMaskInfoList;
|
||||
};
|
||||
|
||||
|
||||
class LLMaskedMorph
|
||||
{
|
||||
public:
|
||||
LLMaskedMorph(LLVisualParam *morph_target, BOOL invert, std::string layer);
|
||||
|
||||
LLVisualParam *mMorphTarget;
|
||||
BOOL mInvert;
|
||||
std::string mLayer;
|
||||
};
|
||||
|
||||
/** Support classes
|
||||
** **
|
||||
|
||||
@@ -488,70 +488,6 @@ LLVOAvatarSelf::~LLVOAvatarSelf()
|
||||
** **
|
||||
*********************************************************************************/
|
||||
|
||||
//virtual
|
||||
BOOL LLVOAvatarSelf::loadLayersets()
|
||||
{
|
||||
BOOL success = TRUE;
|
||||
for (LLVOAvatarXmlInfo::layer_info_list_t::const_iterator iter = sAvatarXmlInfo->mLayerInfoList.begin();
|
||||
iter != sAvatarXmlInfo->mLayerInfoList.end();
|
||||
++iter)
|
||||
{
|
||||
// Construct a layerset for each one specified in avatar_lad.xml and initialize it as such.
|
||||
const LLTexLayerSetInfo *info = *iter;
|
||||
LLViewerTexLayerSet* layer_set = new LLViewerTexLayerSet( this );
|
||||
|
||||
if (!layer_set->setInfo(info))
|
||||
{
|
||||
stop_glerror();
|
||||
delete layer_set;
|
||||
llwarns << "avatar file: layer_set->parseData() failed" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// scan baked textures and associate the layerset with the appropriate one
|
||||
EBakedTextureIndex baked_index = BAKED_NUM_INDICES;
|
||||
for (LLAvatarAppearanceDictionary::BakedTextures::const_iterator baked_iter = LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().begin();
|
||||
baked_iter != LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().end();
|
||||
++baked_iter)
|
||||
{
|
||||
const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = baked_iter->second;
|
||||
if (layer_set->isBodyRegion(baked_dict->mName))
|
||||
{
|
||||
baked_index = baked_iter->first;
|
||||
// ensure both structures are aware of each other
|
||||
mBakedTextureDatas[baked_index].mTexLayerSet = layer_set;
|
||||
layer_set->setBakedTexIndex(baked_index);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// if no baked texture was found, warn and cleanup
|
||||
if (baked_index == BAKED_NUM_INDICES)
|
||||
{
|
||||
llwarns << "<layer_set> has invalid body_region attribute" << llendl;
|
||||
delete layer_set;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// scan morph masks and let any affected layers know they have an associated morph
|
||||
for (LLVOAvatar::morph_list_t::const_iterator morph_iter = mBakedTextureDatas[baked_index].mMaskedMorphs.begin();
|
||||
morph_iter != mBakedTextureDatas[baked_index].mMaskedMorphs.end();
|
||||
++morph_iter)
|
||||
{
|
||||
LLMaskedMorph *morph = *morph_iter;
|
||||
LLTexLayerInterface* layer = layer_set->findLayerByName(morph->mLayer);
|
||||
if (layer)
|
||||
{
|
||||
layer->setHasMorph(TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Could not find layer named " << morph->mLayer << " to set morph flag" << llendl;
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return success;
|
||||
}
|
||||
// virtual
|
||||
BOOL LLVOAvatarSelf::updateCharacter(LLAgent &agent)
|
||||
{
|
||||
@@ -570,10 +506,16 @@ BOOL LLVOAvatarSelf::updateCharacter(LLAgent &agent)
|
||||
return LLVOAvatar::updateCharacter(agent);
|
||||
}
|
||||
|
||||
// virtual
|
||||
BOOL LLVOAvatarSelf::isValid() const
|
||||
{
|
||||
return ((getRegion() != NULL) && !isDead());
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLVOAvatarSelf::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
|
||||
{
|
||||
if (isAgentAvatarValid())
|
||||
if (isValid())
|
||||
{
|
||||
LLVOAvatar::idleUpdate(agent, world, time);
|
||||
if(!gNoRender)
|
||||
@@ -870,7 +812,7 @@ void LLVOAvatarSelf::idleUpdateTractorBeam()
|
||||
}
|
||||
|
||||
// This is only done for yourself (maybe it should be in the agent?)
|
||||
if (!needsRenderBeam() || !mIsBuilt)
|
||||
if (!needsRenderBeam() || !isBuilt())
|
||||
{
|
||||
mBeam = NULL;
|
||||
}
|
||||
@@ -984,11 +926,6 @@ void LLVOAvatarSelf::updateAttachmentVisibility(U32 camera_mode)
|
||||
}
|
||||
}
|
||||
|
||||
/*virtual*/ BOOL LLVOAvatarSelf::isWearingWearableType(LLWearableType::EType type ) const
|
||||
{
|
||||
return gAgentWearables.getWearableCount(type) > 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// updatedWearable( LLWearableType::EType type )
|
||||
// forces an update to any baked textures relevant to type.
|
||||
@@ -1012,7 +949,7 @@ void LLVOAvatarSelf::wearableUpdated( LLWearableType::EType type, BOOL upload_re
|
||||
const LLWearableType::EType comp_type = *type_iter;
|
||||
if (comp_type == type)
|
||||
{
|
||||
LLViewerTexLayerSet *layerset = dynamic_cast<LLViewerTexLayerSet*>(mBakedTextureDatas[index].mTexLayerSet);
|
||||
LLViewerTexLayerSet *layerset = getLayerSet(index);
|
||||
if (layerset)
|
||||
{
|
||||
layerset->setUpdatesEnabled(true);
|
||||
@@ -1230,7 +1167,7 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object)
|
||||
// Make sure the inventory is in sync with the avatar.
|
||||
|
||||
// Update COF contents, don't trigger appearance update.
|
||||
if (!isAgentAvatarValid())
|
||||
if (!isValid())
|
||||
{
|
||||
llinfos << "removeItemLinks skipped, avatar is under destruction" << llendl;
|
||||
}
|
||||
@@ -1320,7 +1257,7 @@ void LLVOAvatarSelf::localTextureLoaded(BOOL success, LLViewerFetchedTexture *sr
|
||||
discard_level < local_tex_obj->getDiscard())
|
||||
{
|
||||
local_tex_obj->setDiscard(discard_level);
|
||||
if (isUsingBakedTextures())
|
||||
if (!isEditingAppearance())
|
||||
{
|
||||
requestLayerSetUpdate(index);
|
||||
}
|
||||
@@ -1769,7 +1706,7 @@ void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerTexture* src_te
|
||||
return;
|
||||
}
|
||||
LLWearableType::EType wearable_type = LLAvatarAppearanceDictionary::getInstance()->getTEWearableType(type);
|
||||
if (!gAgentWearables.getWearable(wearable_type,index))
|
||||
if (!gAgentWearables.getViewerWearable(wearable_type,index))
|
||||
{
|
||||
// no wearable is loaded, cannot set the texture.
|
||||
return;
|
||||
@@ -1785,7 +1722,7 @@ void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerTexture* src_te
|
||||
LLViewerTexLayerSet *layer_set = getLayerSet(type);
|
||||
if (layer_set)
|
||||
{
|
||||
layer_set->cloneTemplates(local_tex_obj, type, gAgentWearables.getWearable(wearable_type,index));
|
||||
layer_set->cloneTemplates(local_tex_obj, type, gAgentWearables.getViewerWearable(wearable_type,index));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1805,11 +1742,11 @@ void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerTexture* src_te
|
||||
local_tex_obj->setDiscard(tex_discard);
|
||||
if (isSelf())
|
||||
{
|
||||
if (gAgentAvatarp->isUsingBakedTextures())
|
||||
if (!isEditingAppearance())
|
||||
{
|
||||
requestLayerSetUpdate(type);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
LLVisualParamHint::requestHintUpdates();
|
||||
}
|
||||
@@ -2499,13 +2436,10 @@ void LLVOAvatarSelf::processRebakeAvatarTextures(LLMessageSystem* msg, void**)
|
||||
}
|
||||
}
|
||||
|
||||
bool LLVOAvatarSelf::isUsingBakedTextures() const
|
||||
BOOL LLVOAvatarSelf::isEditingAppearance() const
|
||||
{
|
||||
// Composite textures are used during appearance mode.
|
||||
if (gAgentCamera.cameraCustomizeAvatar())
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
return gAgentCamera.cameraCustomizeAvatar();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -67,9 +67,8 @@ public:
|
||||
protected:
|
||||
/*virtual*/ BOOL loadAvatar();
|
||||
BOOL loadAvatarSelf();
|
||||
virtual BOOL buildSkeletonSelf(const LLAvatarSkeletonInfo *info);
|
||||
BOOL buildSkeletonSelf(const LLAvatarSkeletonInfo *info);
|
||||
BOOL buildMenus();
|
||||
/*virtual*/ BOOL loadLayersets();
|
||||
|
||||
/** Initialization
|
||||
** **
|
||||
@@ -129,6 +128,7 @@ private:
|
||||
|
||||
public:
|
||||
/*virtual*/ bool isSelf() const { return true; }
|
||||
/*virtual*/ BOOL isValid() const;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Updates
|
||||
@@ -237,7 +237,8 @@ public:
|
||||
void setCachedBakedTexture(LLAvatarAppearanceDefines::ETextureIndex i, const LLUUID& uuid);
|
||||
void forceBakeAllTextures(bool slam_for_debug = false);
|
||||
static void processRebakeAvatarTextures(LLMessageSystem* msg, void**);
|
||||
virtual bool isUsingBakedTextures() const; // e.g. false if in appearance edit mode
|
||||
/*virtual*/ BOOL isEditingAppearance() const;
|
||||
|
||||
protected:
|
||||
/*virtual*/ void removeMissingBakedTextures();
|
||||
|
||||
@@ -297,7 +298,6 @@ protected:
|
||||
**/
|
||||
|
||||
public:
|
||||
/*virtual*/ BOOL isWearingWearableType(LLWearableType::EType type) const;
|
||||
void wearableUpdated(LLWearableType::EType type, BOOL upload_result);
|
||||
protected:
|
||||
U32 getNumWearables(LLAvatarAppearanceDefines::ETextureIndex i) const;
|
||||
|
||||
Reference in New Issue
Block a user