本文整理汇总了C++中LLAvatarJoint::getLOD方法的典型用法代码示例。如果您正苦于以下问题:C++ LLAvatarJoint::getLOD方法的具体用法?C++ LLAvatarJoint::getLOD怎么用?C++ LLAvatarJoint::getLOD使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLAvatarJoint
的用法示例。
在下文中一共展示了LLAvatarJoint::getLOD方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateLOD
BOOL LLAvatarJoint::updateLOD(F32 pixel_area, BOOL activate)
{
BOOL lod_changed = FALSE;
BOOL found_lod = FALSE;
for (child_list_t::iterator iter = mChildren.begin();
iter != mChildren.end(); ++iter)
{
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
F32 jointLOD = joint->getLOD();
if (found_lod || jointLOD == DEFAULT_AVATAR_JOINT_LOD)
{
// we've already found a joint to enable, so enable the rest as alternatives
lod_changed |= joint->updateLOD(pixel_area, TRUE);
}
else
{
if (pixel_area >= jointLOD || sDisableLOD)
{
lod_changed |= joint->updateLOD(pixel_area, TRUE);
found_lod = TRUE;
}
else
{
lod_changed |= joint->updateLOD(pixel_area, FALSE);
}
}
}
return lod_changed;
}
示例2: render
//--------------------------------------------------------------------
// render()
//--------------------------------------------------------------------
U32 LLViewerJoint::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy )
{
stop_glerror();
U32 triangle_count = 0;
//----------------------------------------------------------------
// ignore invisible objects
//----------------------------------------------------------------
if ( mValid )
{
//----------------------------------------------------------------
// if object is transparent, defer it, otherwise
// give the joint subclass a chance to draw itself
//----------------------------------------------------------------
if ( is_dummy )
{
triangle_count += drawShape( pixelArea, first_pass, is_dummy );
}
else if (LLPipeline::sShadowRender)
{
triangle_count += drawShape(pixelArea, first_pass, is_dummy );
}
else if ( isTransparent() && !LLPipeline::sReflectionRender)
{
// Hair and Skirt
if ((pixelArea > MIN_PIXEL_AREA_3PASS_HAIR))
{
// render all three passes
LLGLDisable cull(GL_CULL_FACE);
// first pass renders without writing to the z buffer
{
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
triangle_count += drawShape( pixelArea, first_pass, is_dummy );
}
// second pass writes to z buffer only
gGL.setColorMask(false, false);
{
triangle_count += drawShape( pixelArea, FALSE, is_dummy );
}
// third past respects z buffer and writes color
gGL.setColorMask(true, false);
{
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
triangle_count += drawShape( pixelArea, FALSE, is_dummy );
}
}
else
{
// Render Inside (no Z buffer write)
glCullFace(GL_FRONT);
{
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
triangle_count += drawShape( pixelArea, first_pass, is_dummy );
}
// Render Outside (write to the Z buffer)
glCullFace(GL_BACK);
{
triangle_count += drawShape( pixelArea, FALSE, is_dummy );
}
}
}
else
{
// set up render state
triangle_count += drawShape( pixelArea, first_pass );
}
}
//----------------------------------------------------------------
// render children
//----------------------------------------------------------------
for (child_list_t::iterator iter = mChildren.begin();
iter != mChildren.end(); ++iter)
{
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
if (!joint)
continue;
F32 jointLOD = joint->getLOD();
if (pixelArea >= jointLOD || sDisableLOD)
{
triangle_count += joint->render( pixelArea, TRUE, is_dummy );
if (jointLOD != DEFAULT_AVATAR_JOINT_LOD)
{
break;
}
}
}
return triangle_count;
}