本文整理汇总了C++中LLViewerVisualParam::getWearableType方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerVisualParam::getWearableType方法的具体用法?C++ LLViewerVisualParam::getWearableType怎么用?C++ LLViewerVisualParam::getWearableType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerVisualParam
的用法示例。
在下文中一共展示了LLViewerVisualParam::getWearableType方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createVisualParams
void LLWearable::createVisualParams()
{
for (LLViewerVisualParam* param = (LLViewerVisualParam*) gAgentAvatarp->getFirstVisualParam();
param;
param = (LLViewerVisualParam*) gAgentAvatarp->getNextVisualParam())
{
if (param->getWearableType() == mType)
{
addVisualParam(param->cloneParam(this));
}
}
// resync driver parameters to point to the newly cloned driven parameters
for (visual_param_index_map_t::iterator param_iter = mVisualParamIndexMap.begin();
param_iter != mVisualParamIndexMap.end();
++param_iter)
{
LLVisualParam* param = param_iter->second;
LLVisualParam*(LLWearable::*wearable_function)(S32)const = &LLWearable::getVisualParam;
// need this line to disambiguate between versions of LLCharacter::getVisualParam()
LLVisualParam*(LLVOAvatarSelf::*avatar_function)(S32)const = &LLVOAvatarSelf::getVisualParam;
param->resetDrivenParams();
if(!param->linkDrivenParams(boost::bind(wearable_function,(LLWearable*)this, _1), false))
{
if( !param->linkDrivenParams(boost::bind(avatar_function,gAgentAvatarp.get(),_1 ), true))
{
llwarns << "could not link driven params for wearable " << getName() << " id: " << param->getID() << llendl;
continue;
}
}
}
}
示例2: copyDataFrom
// Does not copy mAssetID.
// Definition version is current: removes obsolete enties and creates default values for new ones.
void LLWearable::copyDataFrom(const LLWearable* src)
{
if (!isAgentAvatarValid()) return;
mDefinitionVersion = LLWearable::sCurrentDefinitionVersion;
mName = src->mName;
mDescription = src->mDescription;
mPermissions = src->mPermissions;
mSaleInfo = src->mSaleInfo;
setType(src->mType);
mSavedVisualParamMap.clear();
// Deep copy of mVisualParamMap (copies only those params that are current, filling in defaults where needed)
for (LLViewerVisualParam* param = (LLViewerVisualParam*) gAgentAvatarp->getFirstVisualParam();
param;
param = (LLViewerVisualParam*) gAgentAvatarp->getNextVisualParam() )
{
if( (param->getWearableType() == mType) )
{
S32 id = param->getID();
F32 weight = src->getVisualParamWeight(id);
mSavedVisualParamMap[id] = weight;
}
}
destroyTextures();
// Deep copy of mTEMap (copies only those tes that are current, filling in defaults where needed)
for (S32 te = 0; te < TEX_NUM_INDICES; te++)
{
if (LLVOAvatarDictionary::getTEWearableType((ETextureIndex) te) == mType)
{
te_map_t::const_iterator iter = src->mTEMap.find(te);
LLUUID image_id;
LLViewerFetchedTexture *image = NULL;
if(iter != src->mTEMap.end())
{
image = src->getLocalTextureObject(te)->getImage();
image_id = src->getLocalTextureObject(te)->getID();
mTEMap[te] = new LLLocalTextureObject(image, image_id);
mSavedTEMap[te] = new LLLocalTextureObject(image, image_id);
mTEMap[te]->setBakedReady(src->getLocalTextureObject(te)->getBakedReady());
mTEMap[te]->setDiscard(src->getLocalTextureObject(te)->getDiscard());
}
else
{
image_id = LLVOAvatarDictionary::getDefaultTextureImageID((ETextureIndex) te);
image = LLViewerTextureManager::getFetchedTexture( image_id );
mTEMap[te] = new LLLocalTextureObject(image, image_id);
mSavedTEMap[te] = new LLLocalTextureObject(image, image_id);
}
createLayers(te);
}
}
// Probably reduntant, but ensure that the newly created wearable is not dirty by setting current value of params in new wearable
// to be the same as the saved values (which were loaded from src at param->cloneParam(this))
revertValues();
}
示例3: createVisualParams
void LLWearable::createVisualParams(LLAvatarAppearance *avatarp)
{
for (LLViewerVisualParam* param = (LLViewerVisualParam*) avatarp->getFirstVisualParam();
param;
param = (LLViewerVisualParam*) avatarp->getNextVisualParam())
{
if (param->getWearableType() == mType)
{
LLVisualParam *clone_param = param->cloneParam(this);
clone_param->setParamLocation(LOC_UNKNOWN);
clone_param->setParamLocation(LOC_WEARABLE);
addVisualParam(clone_param);
}
}
// resync driver parameters to point to the newly cloned driven parameters
for (visual_param_index_map_t::iterator param_iter = mVisualParamIndexMap.begin();
param_iter != mVisualParamIndexMap.end();
++param_iter)
{
LLVisualParam* param = param_iter->second;
LLVisualParam*(LLWearable::*wearable_function)(S32)const = &LLWearable::getVisualParam;
// need this line to disambiguate between versions of LLCharacter::getVisualParam()
LLVisualParam*(LLAvatarAppearance::*param_function)(S32)const = &LLAvatarAppearance::getVisualParam;
param->resetDrivenParams();
if(!param->linkDrivenParams(boost::bind(wearable_function,(LLWearable*)this, _1), false))
{
if( !param->linkDrivenParams(boost::bind(param_function,avatarp,_1 ), true))
{
LL_WARNS() << "could not link driven params for wearable " << getName() << " id: " << param->getID() << LL_ENDL;
continue;
}
}
}
}
示例4: isOldVersion
// Avatar parameter and texture definitions can change over time.
// This function returns true if parameters or textures have been added or removed
// since this wearable was created.
BOOL LLWearable::isOldVersion()
{
LLVOAvatar* avatar = gAgent.getAvatarObject();
llassert( avatar );
if( !avatar )
{
return FALSE;
}
if( LLWearable::sCurrentDefinitionVersion < mDefinitionVersion )
{
llwarns << "Wearable asset has newer version (" << mDefinitionVersion << ") than XML (" << LLWearable::sCurrentDefinitionVersion << ")" << llendl;
llassert(0);
}
if( LLWearable::sCurrentDefinitionVersion != mDefinitionVersion )
{
return TRUE;
}
S32 param_count = 0;
for( LLViewerVisualParam* param = (LLViewerVisualParam*) avatar->getFirstVisualParam();
param;
param = (LLViewerVisualParam*) avatar->getNextVisualParam() )
{
if (param->getWearableType() == mType && param->isTweakable())
{
param_count++;
if( !is_in_map(mVisualParamMap, param->getID() ) )
{
return TRUE;
}
}
}
if( param_count != mVisualParamMap.size() )
{
return TRUE;
}
S32 te_count = 0;
for( S32 te = 0; te < TEX_NUM_INDICES; te++ )
{
if( LLVOAvatar::getTEWearableType((ETextureIndex) te ) == mType )
{
te_count++;
if( !is_in_map(mTEMap, te ) )
{
return TRUE;
}
}
}
if( te_count != mTEMap.size() )
{
return TRUE;
}
return FALSE;
}
示例5: isOldVersion
// Avatar parameter and texture definitions can change over time.
// This function returns true if parameters or textures have been added or removed
// since this wearable was created.
BOOL LLWearable::isOldVersion()
{
LLVOAvatar* avatar = gAgent.getAvatarObject();
llassert( avatar );
if( !avatar )
{
return FALSE;
}
if( LLWearable::sCurrentDefinitionVersion < mDefinitionVersion )
{
llwarns << "Wearable asset has newer version (" << mDefinitionVersion << ") than XML (" << LLWearable::sCurrentDefinitionVersion << ")" << llendl;
llassert(0);
}
if( LLWearable::sCurrentDefinitionVersion != mDefinitionVersion )
{
return TRUE;
}
S32 param_count = 0;
for( LLViewerVisualParam* param = (LLViewerVisualParam*) avatar->getFirstVisualParam();
param;
param = (LLViewerVisualParam*) avatar->getNextVisualParam() )
{
if( (param->getWearableType() == mType) && (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE ) )
{
param_count++;
if( !is_in_map(mVisualParamMap, param->getID() ) )
{
return TRUE;
}
}
}
if( param_count != mVisualParamMap.size() )
{
return TRUE;
}
S32 te_count = 0;
for( S32 te = 0; te < LLVOAvatar::TEX_NUM_ENTRIES; te++ )
{
if( LLVOAvatar::getTEWearableType( te ) == mType )
{
te_count++;
if( !is_in_map(mTEMap, te ) )
{
return TRUE;
}
}
}
if( te_count != mTEMap.size() )
{
return TRUE;
}
return FALSE;
}
示例6: toStream
//virtual
void LLDriverParamInfo::toStream(std::ostream &out)
{
LLViewerVisualParamInfo::toStream(out);
out << "driver" << "\t";
out << mDrivenInfoList.size() << "\t";
for (entry_info_list_t::iterator iter = mDrivenInfoList.begin(); iter != mDrivenInfoList.end(); iter++)
{
LLDrivenEntryInfo driven = *iter;
out << driven.mDrivenID << "\t";
}
out << std::endl;
// FIXME - this mDriverParam backlink makes no sense, because the
// LLDriverParamInfos are static objects - there's only one copy
// for each param type, so the backlink will just reference the
// corresponding param in the most recently created
// avatar. Apparently these toStream() methods are not currently
// used anywhere, so it's not an urgent problem.
LL_WARNS_ONCE() << "Invalid usage of mDriverParam." << LL_ENDL;
if(mDriverParam && mDriverParam->getAvatarAppearance()->isSelf() &&
mDriverParam->getAvatarAppearance()->isValid())
{
for (entry_info_list_t::iterator iter = mDrivenInfoList.begin(); iter != mDrivenInfoList.end(); iter++)
{
LLDrivenEntryInfo driven = *iter;
LLViewerVisualParam *param =
(LLViewerVisualParam*)mDriverParam->getAvatarAppearance()->getVisualParam(driven.mDrivenID);
if (param)
{
param->getInfo()->toStream(out);
if (param->getWearableType() != mWearableType)
{
if(param->getCrossWearable())
{
out << "cross-wearable" << "\t";
}
else
{
out << "ERROR!" << "\t";
}
}
else
{
out << "valid" << "\t";
}
}
else
{
LL_WARNS() << "could not get parameter " << driven.mDrivenID << " from avatar "
<< mDriverParam->getAvatarAppearance()
<< " for driver parameter " << getID() << LL_ENDL;
}
out << std::endl;
}
}
}
示例7: isDirty
// Avatar parameter and texture definitions can change over time.
// * If parameters or textures have been REMOVED since the wearable was created,
// they're just ignored, so we consider the wearable clean even though isOldVersion()
// will return true.
// * If parameters or textures have been ADDED since the wearable was created,
// they are taken to have default values, so we consider the wearable clean
// only if those values are the same as the defaults.
BOOL LLViewerWearable::isDirty() const
{
if (!isAgentAvatarValid()) return FALSE;
for( LLViewerVisualParam* param = (LLViewerVisualParam*) gAgentAvatarp->getFirstVisualParam();
param;
param = (LLViewerVisualParam*) gAgentAvatarp->getNextVisualParam() )
{
if( (param->getWearableType() == mType)
&& (param->isTweakable() )
&& !param->getCrossWearable())
{
F32 current_weight = getVisualParamWeight(param->getID());
current_weight = llclamp( current_weight, param->getMinWeight(), param->getMaxWeight() );
F32 saved_weight = get_if_there(mSavedVisualParamMap, param->getID(), param->getDefaultWeight());
saved_weight = llclamp( saved_weight, param->getMinWeight(), param->getMaxWeight() );
U8 a = F32_to_U8( saved_weight, param->getMinWeight(), param->getMaxWeight() );
U8 b = F32_to_U8( current_weight, param->getMinWeight(), param->getMaxWeight() );
if( a != b )
{
//LL_WARNS() << "param ID " << param->getID() << " was changed." << LL_ENDL;
return TRUE;
}
}
}
for( S32 te = 0; te < TEX_NUM_INDICES; te++ )
{
if (LLAvatarAppearanceDictionary::getTEWearableType((ETextureIndex) te) == mType)
{
te_map_t::const_iterator current_iter = mTEMap.find(te);
if(current_iter != mTEMap.end())
{
const LLUUID& current_image_id = current_iter->second->getID();
te_map_t::const_iterator saved_iter = mSavedTEMap.find(te);
if(saved_iter != mSavedTEMap.end())
{
const LLUUID& saved_image_id = saved_iter->second->getID();
if (saved_image_id != current_image_id)
{
// saved vs current images are different, wearable is dirty
return TRUE;
}
}
else
{
// image found in current image list but not saved image list
return TRUE;
}
}
}
}
return FALSE;
}
示例8: isDirty
// Avatar parameter and texture definitions can change over time.
// * If parameters or textures have been REMOVED since the wearable was created,
// they're just ignored, so we consider the wearable clean even though isOldVersion()
// will return true.
// * If parameters or textures have been ADDED since the wearable was created,
// they are taken to have default values, so we consider the wearable clean
// only if those values are the same as the defaults.
BOOL LLWearable::isDirty()
{
LLVOAvatar* avatar = gAgent.getAvatarObject();
llassert( avatar );
if( !avatar )
{
return FALSE;
}
for( LLViewerVisualParam* param = (LLViewerVisualParam*) avatar->getFirstVisualParam();
param;
param = (LLViewerVisualParam*) avatar->getNextVisualParam() )
{
if (param->getWearableType() == mType && param->isTweakable())
{
F32 weight = get_if_there(mVisualParamMap, param->getID(), param->getDefaultWeight());
weight = llclamp( weight, param->getMinWeight(), param->getMaxWeight() );
U8 a = F32_to_U8( param->getWeight(), param->getMinWeight(), param->getMaxWeight() );
U8 b = F32_to_U8( weight, param->getMinWeight(), param->getMaxWeight() );
if( a != b )
{
return TRUE;
}
}
}
for( S32 te = 0; te < TEX_NUM_INDICES; te++ )
{
if( LLVOAvatar::getTEWearableType((ETextureIndex) te ) == mType )
{
LLViewerImage* avatar_image = avatar->getTEImage( te );
if( !avatar_image )
{
llassert( 0 );
continue;
}
const LLUUID& image_id = get_if_there(mTEMap, te, LLVOAvatar::getDefaultTEImageID((ETextureIndex) te ) );
if( avatar_image->getID() != image_id )
{
return TRUE;
}
}
}
//if( gFloaterCustomize )
//{
// if( mDescription != gFloaterCustomize->getWearableDescription( mType ) )
// {
// return TRUE;
// }
//}
return FALSE;
}
示例9: isOldVersion
// Avatar parameter and texture definitions can change over time.
// This function returns true if parameters or textures have been added or removed
// since this wearable was created.
BOOL LLViewerWearable::isOldVersion() const
{
if (!isAgentAvatarValid()) return FALSE;
if( LLWearable::sCurrentDefinitionVersion < mDefinitionVersion )
{
llwarns << "Wearable asset has newer version (" << mDefinitionVersion << ") than XML (" << LLWearable::sCurrentDefinitionVersion << ")" << llendl;
llassert(0);
}
if( LLWearable::sCurrentDefinitionVersion != mDefinitionVersion )
{
return TRUE;
}
S32 param_count = 0;
for( LLViewerVisualParam* param = (LLViewerVisualParam*) gAgentAvatarp->getFirstVisualParam();
param;
param = (LLViewerVisualParam*) gAgentAvatarp->getNextVisualParam() )
{
if( (param->getWearableType() == mType) && (param->isTweakable() ) )
{
param_count++;
if( !is_in_map(mVisualParamIndexMap, param->getID() ) )
{
return TRUE;
}
}
}
if( param_count != mVisualParamIndexMap.size() )
{
return TRUE;
}
S32 te_count = 0;
for( S32 te = 0; te < TEX_NUM_INDICES; te++ )
{
if (LLAvatarAppearanceDictionary::getTEWearableType((ETextureIndex) te) == mType)
{
te_count++;
if( !is_in_map(mTEMap, te ) )
{
return TRUE;
}
}
}
if( te_count != mTEMap.size() )
{
return TRUE;
}
return FALSE;
}
示例10: toStream
//virtual
void LLDriverParamInfo::toStream(std::ostream &out)
{
LLViewerVisualParamInfo::toStream(out);
out << "driver" << "\t";
out << mDrivenInfoList.size() << "\t";
for (entry_info_list_t::iterator iter = mDrivenInfoList.begin(); iter != mDrivenInfoList.end(); iter++)
{
LLDrivenEntryInfo driven = *iter;
out << driven.mDrivenID << "\t";
}
out << std::endl;
LLVOAvatarSelf *avatar = gAgent.getAvatarObject();
if(avatar)
{
for (entry_info_list_t::iterator iter = mDrivenInfoList.begin(); iter != mDrivenInfoList.end(); iter++)
{
LLDrivenEntryInfo driven = *iter;
LLViewerVisualParam *param = (LLViewerVisualParam*)avatar->getVisualParam(driven.mDrivenID);
if (param)
{
param->getInfo()->toStream(out);
if (param->getWearableType() != mWearableType)
{
if(param->getCrossWearable())
{
out << "cross-wearable" << "\t";
}
else
{
out << "ERROR!" << "\t";
}
}
else
{
out << "valid" << "\t";
}
}
else
{
llwarns << "could not get parameter " << driven.mDrivenID << " from avatar " << avatar << " for driver parameter " << getID() << llendl;
}
out << std::endl;
}
}
}
示例11: copyDataFrom
// Does not copy mAssetID.
// Definition version is current: removes obsolete enties and creates default values for new ones.
void LLWearable::copyDataFrom( LLWearable* src )
{
LLVOAvatar* avatar = gAgent.getAvatarObject();
llassert( avatar );
if( !avatar )
{
return;
}
mDefinitionVersion = LLWearable::sCurrentDefinitionVersion;
mName = src->mName;
mDescription = src->mDescription;
mPermissions = src->mPermissions;
mSaleInfo = src->mSaleInfo;
mType = src->mType;
// Deep copy of mVisualParamMap (copies only those params that are current, filling in defaults where needed)
for( LLViewerVisualParam* param = (LLViewerVisualParam*) avatar->getFirstVisualParam();
param;
param = (LLViewerVisualParam*) avatar->getNextVisualParam() )
{
if( (param->getWearableType() == mType) && (param->isTweakable() ) )
{
S32 id = param->getID();
F32 weight = get_if_there(src->mVisualParamMap, id, param->getDefaultWeight() );
if(id == 507)
avatar->setActualBoobGrav(weight);
mVisualParamMap[id] = weight;
}
}
// Deep copy of mTEMap (copies only those tes that are current, filling in defaults where needed)
for( S32 te = 0; te < TEX_NUM_INDICES; te++ )
{
if( LLVOAvatar::getTEWearableType((ETextureIndex) te ) == mType )
{
const LLUUID& image_id = get_if_there(src->mTEMap, te, LLVOAvatar::getDefaultTEImageID((ETextureIndex) te ) );
mTEMap[te] = image_id;
}
}
}
示例12: isDirty
// Avatar parameter and texture definitions can change over time.
// * If parameters or textures have been REMOVED since the wearable was created,
// they're just ignored, so we consider the wearable clean even though isOldVersion()
// will return true.
// * If parameters or textures have been ADDED since the wearable was created,
// they are taken to have default values, so we consider the wearable clean
// only if those values are the same as the defaults.
BOOL LLWearable::isDirty() const
{
LLVOAvatar* avatar = gAgent.getAvatarObject();
llassert( avatar );
if( !avatar )
{
return FALSE;
}
for( LLViewerVisualParam* param = (LLViewerVisualParam*) avatar->getFirstVisualParam();
param;
param = (LLViewerVisualParam*) avatar->getNextVisualParam() )
{
if( (param->getWearableType() == mType)
&& (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE )
&& !param->getCrossWearable())
{
F32 current_weight = getVisualParamWeight(param->getID());
current_weight = llclamp( current_weight, param->getMinWeight(), param->getMaxWeight() );
F32 saved_weight = get_if_there(mSavedVisualParamMap, param->getID(), param->getDefaultWeight());
saved_weight = llclamp( saved_weight, param->getMinWeight(), param->getMaxWeight() );
U8 a = F32_to_U8( saved_weight, param->getMinWeight(), param->getMaxWeight() );
U8 b = F32_to_U8( current_weight, param->getMinWeight(), param->getMaxWeight() );
if( a != b )
{
return TRUE;
}
}
}
for( S32 te = 0; te < TEX_NUM_INDICES; te++ )
{
if (LLVOAvatarDictionary::getTEWearableType((ETextureIndex) te) == mType)
{
te_map_t::const_iterator current_iter = mTEMap.find(te);
if(current_iter != mTEMap.end())
{
const LLUUID& current_image_id = current_iter->second->getID();
te_map_t::const_iterator saved_iter = mSavedTEMap.find(te);
if(saved_iter != mSavedTEMap.end())
{
const LLUUID& saved_image_id = saved_iter->second->getID();
if (saved_image_id != current_image_id)
{
// saved vs current images are different, wearable is dirty
return TRUE;
}
}
else
{
// image found in current image list but not saved image list
return TRUE;
}
}
}
}
//if( gFloaterCustomize )
//{
// if( mDescription != gFloaterCustomize->getWearableDescription( mType ) )
// {
// return TRUE;
// }
//}
return FALSE;
}
示例13: isDirty
// Avatar parameter and texture definitions can change over time.
// * If parameters or textures have been REMOVED since the wearable was created,
// they're just ignored, so we consider the wearable clean even though isOldVersion()
// will return true.
// * If parameters or textures have been ADDED since the wearable was created,
// they are taken to have default values, so we consider the wearable clean
// only if those values are the same as the defaults.
BOOL LLWearable::isDirty()
{
LLVOAvatar* avatar = gAgent.getAvatarObject();
llassert( avatar );
if( !avatar )
{
return FALSE;
}
for( LLViewerVisualParam* param = (LLViewerVisualParam*) avatar->getFirstVisualParam();
param;
param = (LLViewerVisualParam*) avatar->getNextVisualParam() )
{
if (param->getWearableType() == mType && param->isTweakable())
{
F32 weight = get_if_there(mVisualParamMap, param->getID(), param->getDefaultWeight());
weight = llclamp( weight, param->getMinWeight(), param->getMaxWeight() );
U8 a = F32_to_U8( param->getWeight(), param->getMinWeight(), param->getMaxWeight() );
if(avatar->getAppearanceFlag() == true)
{
//boob
if(param->getID() == 507)
{
weight = get_if_there(mVisualParamMap, param->getID(), avatar->getActualBoobGrav());
weight = llclamp( weight, param->getMinWeight(), param->getMaxWeight() );
}
//butt
if(param->getID() == 795)
{
weight = get_if_there(mVisualParamMap, param->getID(), avatar->getActualButtGrav());
weight = llclamp( weight, param->getMinWeight(), param->getMaxWeight() );
}
//fat
if(param->getID() == 157)
{
weight = get_if_there(mVisualParamMap, param->getID(), avatar->getActualFatGrav());
weight = llclamp( weight, param->getMinWeight(), param->getMaxWeight() );
}
}
else
{
//boob
if(param->getID() == 507)
{
a = F32_to_U8( avatar->getActualBoobGrav(), param->getMinWeight(), param->getMaxWeight() );
}
//butt
if(param->getID() == 795)
{
a = F32_to_U8( avatar->getActualButtGrav(), param->getMinWeight(), param->getMaxWeight() );
}
//fat
if(param->getID() == 157)
{
a = F32_to_U8( avatar->getActualFatGrav(), param->getMinWeight(), param->getMaxWeight() );
}
}
U8 b = F32_to_U8( weight, param->getMinWeight(), param->getMaxWeight() );
if( a != b )
{
llwarns << "param ID " << param->getID() << " was changed." << llendl;
return TRUE;
}
}
}
for( S32 te = 0; te < TEX_NUM_INDICES; te++ )
{
if( LLVOAvatar::getTEWearableType((ETextureIndex) te ) == mType )
{
LLViewerImage* avatar_image = avatar->getTEImage( te );
if( !avatar_image )
{
llassert( 0 );
continue;
}
const LLUUID& image_id = get_if_there(mTEMap, te, LLVOAvatar::getDefaultTEImageID((ETextureIndex) te ) );
if( avatar_image->getID() != image_id )
{
return TRUE;
}
}
}
//if( gFloaterCustomize )
//{
// if( mDescription != gFloaterCustomize->getWearableDescription( mType ) )
// {
//.........这里部分代码省略.........
示例14: copyDataFrom
// Does not copy mAssetID.
// Definition version is current: removes obsolete enties and creates default values for new ones.
void LLWearable::copyDataFrom( LLWearable* src )
{
LLVOAvatar* avatar = gAgent.getAvatarObject();
llassert( avatar );
if( !avatar )
{
return;
}
mDefinitionVersion = LLWearable::sCurrentDefinitionVersion;
mName = src->mName;
mDescription = src->mDescription;
mPermissions = src->mPermissions;
mSaleInfo = src->mSaleInfo;
mType = src->mType;
// Deep copy of mVisualParamMap (copies only those params that are current, filling in defaults where needed)
for( LLViewerVisualParam* param = (LLViewerVisualParam*) avatar->getFirstVisualParam();
param;
param = (LLViewerVisualParam*) avatar->getNextVisualParam() )
{
if( (param->getWearableType() == mType) && (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE ) )
{
S32 id = param->getID();
F32 weight = get_if_there(src->mVisualParamMap, id, param->getDefaultWeight() );
//llwarns << "------------------------------" << llendl;
//llwarns << "copydatafrom" << llendl;
//llwarns << "------------------------------" << llendl;
//if(id == 507)
//{
// llwarns << "weight = " << weight << llendl;
// llwarns << "actual = " << avatar->getActualBoobGrav() << llendl;
// llwarns << "mVisualParamMap[id] = " << mVisualParamMap[id] << llendl;
//}
//pretty sure right
if(id == 507)
avatar->setActualBoobGrav(weight);
/*if(id == 795)
avatar->setActualButtGrav(weight);
if(id == 157)
avatar->setActualFatGrav(weight);
*/
mVisualParamMap[id] = weight;
}
}
// Deep copy of mTEMap (copies only those tes that are current, filling in defaults where needed)
for( S32 te = 0; te < TEX_NUM_INDICES; te++ )
{
if( LLVOAvatar::getTEWearableType((ETextureIndex) te ) == mType )
{
const LLUUID& image_id = get_if_there(src->mTEMap, te, LLVOAvatar::getDefaultTEImageID((ETextureIndex) te ) );
mTEMap[te] = image_id;
}
}
}