本文整理汇总了C++中LLViewerVisualParam::getMinWeight方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerVisualParam::getMinWeight方法的具体用法?C++ LLViewerVisualParam::getMinWeight怎么用?C++ LLViewerVisualParam::getMinWeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerVisualParam
的用法示例。
在下文中一共展示了LLViewerVisualParam::getMinWeight方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: onUpdate
// Return TRUE if character has to update visual params.
BOOL LLPhysicsMotion::onUpdate(F32 time)
{
// static FILE *mFileWrite = fopen("c:\\temp\\avatar_data.txt","w");
if (!mParamDriver)
return FALSE;
if (!mLastTime)
{
mLastTime = time;
return FALSE;
}
////////////////////////////////////////////////////////////////////////////////
// Get all parameters and settings
//
const F32 time_delta = time - mLastTime;
// Don't update too frequently, to avoid precision errors from small time slices.
if (time_delta <= .01)
{
return FALSE;
}
// If less than 1FPS, we don't want to be spending time updating physics at all.
if (time_delta > 1.0)
{
mLastTime = time;
return FALSE;
}
// Higher LOD is better. This controls the granularity
// and frequency of updates for the motions.
const F32 lod_factor = LLVOAvatar::sPhysicsLODFactor;
if (lod_factor == 0)
{
return TRUE;
}
LLJoint *joint = mJointState->getJoint();
const F32 behavior_mass = getParamValue("Mass");
const F32 behavior_gravity = getParamValue("Gravity");
const F32 behavior_spring = getParamValue("Spring");
const F32 behavior_gain = getParamValue("Gain");
const F32 behavior_damping = getParamValue("Damping");
const F32 behavior_drag = getParamValue("Drag");
const BOOL physics_test = FALSE; // Enable this to simulate bouncing on all parts.
F32 behavior_maxeffect = getParamValue("MaxEffect");
if (physics_test)
behavior_maxeffect = 1.0f;
// Normalize the param position to be from [0,1].
// We have to use normalized values because there may be more than one driven param,
// and each of these driven params may have its own range.
// This means we'll do all our calculations in normalized [0,1] local coordinates.
const F32 position_user_local = (mParamDriver->getWeight() - mParamDriver->getMinWeight()) / (mParamDriver->getMaxWeight() - mParamDriver->getMinWeight());
//
// End parameters and settings
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Calculate velocity and acceleration in parameter space.
//
//const F32 velocity_joint_local = calculateVelocity_local(time_iteration_step);
const F32 velocity_joint_local = calculateVelocity_local();
const F32 acceleration_joint_local = calculateAcceleration_local(velocity_joint_local);
//
// End velocity and acceleration
////////////////////////////////////////////////////////////////////////////////
BOOL update_visuals = FALSE;
// Break up the physics into a bunch of iterations so that differing framerates will show
// roughly the same behavior.
for (F32 time_iteration = 0; time_iteration <= time_delta; time_iteration += TIME_ITERATION_STEP)
{
F32 time_iteration_step = TIME_ITERATION_STEP;
if (time_iteration + TIME_ITERATION_STEP > time_delta)
{
time_iteration_step = time_delta-time_iteration;
}
// mPositon_local should be in normalized 0,1 range already. Just making sure...
const F32 position_current_local = llclamp(mPosition_local,
0.0f,
1.0f);
// If the effect is turned off then don't process unless we need one more update
// to set the position to the default (i.e. user) position.
if ((behavior_maxeffect == 0) && (position_current_local == position_user_local))
{
return update_visuals;
}
//.........这里部分代码省略.........
示例4: percentToWeight
F32 LLScrollingPanelParam::percentToWeight( F32 percent )
{
LLViewerVisualParam* param = mParam;
return percent / 100.f * (param->getMaxWeight() - param->getMinWeight()) + param->getMinWeight();
}
示例5: weightToPercent
F32 LLScrollingPanelParam::weightToPercent( F32 weight )
{
LLViewerVisualParam* param = mParam;
return (weight - param->getMinWeight()) / (param->getMaxWeight() - param->getMinWeight()) * 100.f;
}
示例6: 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;
}
示例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 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 ) )
// {
//.........这里部分代码省略.........