本文整理汇总了C++中LLVOAvatar::setVisualParamWeight方法的典型用法代码示例。如果您正苦于以下问题:C++ LLVOAvatar::setVisualParamWeight方法的具体用法?C++ LLVOAvatar::setVisualParamWeight怎么用?C++ LLVOAvatar::setVisualParamWeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLVOAvatar
的用法示例。
在下文中一共展示了LLVOAvatar::setVisualParamWeight方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: preRender
void LLVisualParamHint::preRender(BOOL clear_depth)
{
LLVOAvatar* avatarp = gAgent.getAvatarObject();
mLastParamWeight = avatarp->getVisualParamWeight(mVisualParam);
avatarp->setVisualParamWeight(mVisualParam, mVisualParamWeight);
avatarp->setVisualParamWeight("Blink_Left", 0.f);
avatarp->setVisualParamWeight("Blink_Right", 0.f);
avatarp->updateComposites();
avatarp->updateVisualParams();
avatarp->updateGeometry(avatarp->mDrawable);
avatarp->updateLOD();
LLDynamicTexture::preRender(clear_depth);
}
示例2: removeFromAvatar
// Updates the user's avatar's appearance, replacing this wearables' parameters and textures with default values.
// static
void LLWearable::removeFromAvatar( EWearableType type, BOOL set_by_user )
{
LLVOAvatar* avatar = gAgent.getAvatarObject();
llassert( avatar );
if( !avatar )
{
return;
}
// You can't just remove body parts.
if( (type == WT_SHAPE) ||
(type == WT_SKIN) ||
(type == WT_HAIR) ||
(type == WT_EYES) )
{
return;
}
// Pull params
for( LLVisualParam* param = avatar->getFirstVisualParam(); param; param = avatar->getNextVisualParam() )
{
if (((LLViewerVisualParam*)param)->getWearableType() == type && param->isTweakable())
{
S32 param_id = param->getID();
avatar->setVisualParamWeight( param_id, param->getDefaultWeight(), set_by_user );
}
}
// Pull textures
LLViewerImage* image = gImageList.getImage( IMG_DEFAULT_AVATAR );
for( S32 te = 0; te < TEX_NUM_INDICES; te++ )
{
if( LLVOAvatar::getTEWearableType((ETextureIndex) te ) == type )
{
avatar->setLocTexTE( te, image, set_by_user );
}
}
if( gFloaterCustomize )
{
gFloaterCustomize->setWearable(type, NULL, PERM_ALL, TRUE);
}
avatar->updateVisualParams();
avatar->updateMeshTextures();
// if( set_by_user )
// {
// gAgent.sendAgentSetAppearance();
// }
}
示例3: writeToAvatar
// Updates the user's avatar's appearance
void LLWearable::writeToAvatar( BOOL set_by_user )
{
LLVOAvatar* avatar = gAgent.getAvatarObject();
llassert( avatar );
if( !avatar )
{
return;
}
ESex old_sex = avatar->getSex();
// Pull params
for( LLVisualParam* param = avatar->getFirstVisualParam(); param; param = avatar->getNextVisualParam() )
{
if (((LLViewerVisualParam*)param)->getWearableType() == mType && param->isTweakable())
{
S32 param_id = param->getID();
F32 weight = get_if_there(mVisualParamMap, param_id, param->getDefaultWeight());
// only animate with user-originated changes
if (set_by_user)
{
param->setAnimationTarget(weight, set_by_user);
}
else
{
avatar->setVisualParamWeight( param_id, weight, set_by_user );
}
}
}
// only interpolate with user-originated changes
if (set_by_user)
{
avatar->startAppearanceAnimation(TRUE, TRUE);
}
// Pull texture entries
for( S32 te = 0; te < TEX_NUM_INDICES; te++ )
{
if( LLVOAvatar::getTEWearableType((ETextureIndex) te ) == mType )
{
const LLUUID& image_id = get_if_there(mTEMap, te, LLVOAvatar::getDefaultTEImageID((ETextureIndex) te ) );
LLViewerImage* image = gImageList.getImage( image_id );
avatar->setLocTexTE( te, image, set_by_user );
}
}
avatar->updateVisualParams();
if( gFloaterCustomize )
{
LLViewerInventoryItem* item;
item = (LLViewerInventoryItem*)gInventory.getItem(gAgent.getWearableItem(mType));
U32 perm_mask = PERM_NONE;
BOOL is_complete = FALSE;
if(item)
{
perm_mask = item->getPermissions().getMaskOwner();
is_complete = item->isComplete();
if(!is_complete)
{
item->fetchFromServer();
}
}
gFloaterCustomize->setWearable(mType, this, perm_mask, is_complete);
LLFloaterCustomize::setCurrentWearableType( mType );
}
ESex new_sex = avatar->getSex();
if( old_sex != new_sex )
{
avatar->updateSexDependentLayerSets( set_by_user );
}
avatar->updateMeshTextures();
// if( set_by_user )
// {
// gAgent.sendAgentSetAppearance();
// }
}
示例4: render
//-----------------------------------------------------------------------------
// render()
//-----------------------------------------------------------------------------
BOOL LLVisualParamHint::render()
{
LLVisualParamReset::sDirty = TRUE;
LLVOAvatar* avatarp = gAgent.getAvatarObject();
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glOrtho(0.0f, mWidth, 0.0f, mHeight, -1.0f, 1.0f);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
LLGLSUIDefault gls_ui;
//LLGLState::verify(TRUE);
mBackgroundp->draw(0, 0, mWidth, mHeight);
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
mNeedsUpdate = FALSE;
mIsVisible = TRUE;
LLViewerJointMesh* cam_target_joint = NULL;
const std::string& cam_target_mesh_name = mVisualParam->getCameraTargetName();
if( !cam_target_mesh_name.empty() )
{
cam_target_joint = (LLViewerJointMesh*)avatarp->getJoint( cam_target_mesh_name );
}
if( !cam_target_joint )
{
cam_target_joint = (LLViewerJointMesh*)gMorphView->getCameraTargetJoint();
}
if( !cam_target_joint )
{
cam_target_joint = (LLViewerJointMesh*)avatarp->getJoint("mHead");
}
LLQuaternion avatar_rotation;
LLJoint* root_joint = avatarp->getRootJoint();
if( root_joint )
{
avatar_rotation = root_joint->getWorldRotation();
}
LLVector3 target_joint_pos = cam_target_joint->getWorldPosition();
LLVector3 target_offset( 0, 0, mVisualParam->getCameraElevation() );
LLVector3 target_pos = target_joint_pos + (target_offset * avatar_rotation);
F32 cam_angle_radians = mVisualParam->getCameraAngle() * DEG_TO_RAD;
LLVector3 camera_snapshot_offset(
mVisualParam->getCameraDistance() * cosf( cam_angle_radians ),
mVisualParam->getCameraDistance() * sinf( cam_angle_radians ),
mVisualParam->getCameraElevation() );
LLVector3 camera_pos = target_joint_pos + (camera_snapshot_offset * avatar_rotation);
gGL.flush();
LLViewerCamera::getInstance()->setAspect((F32)mWidth / (F32)mHeight);
LLViewerCamera::getInstance()->setOriginAndLookAt(
camera_pos, // camera
LLVector3(0.f, 0.f, 1.f), // up
target_pos ); // point of interest
LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mWidth, mHeight, FALSE);
if (avatarp->mDrawable.notNull())
{
LLDrawPoolAvatar *avatarPoolp = (LLDrawPoolAvatar *)avatarp->mDrawable->getFace(0)->getPool();
LLGLDepthTest gls_depth(GL_TRUE, GL_TRUE);
gGL.setAlphaRejectSettings(LLRender::CF_ALWAYS);
gGL.setSceneBlendType(LLRender::BT_REPLACE);
avatarPoolp->renderAvatars(avatarp); // renders only one avatar
gGL.setSceneBlendType(LLRender::BT_ALPHA);
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
}
avatarp->setVisualParamWeight(mVisualParam, mLastParamWeight);
gGL.color4f(1,1,1,1);
mTexture->setGLTextureCreated(true);
return TRUE;
}