本文整理汇总了C++中LLDrawable::getWorldPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ LLDrawable::getWorldPosition方法的具体用法?C++ LLDrawable::getWorldPosition怎么用?C++ LLDrawable::getWorldPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLDrawable
的用法示例。
在下文中一共展示了LLDrawable::getWorldPosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleRectangleSelection
//.........这里部分代码省略.........
return true;
}
S32 result = LLViewerCamera::getInstance()->sphereInFrustum(drawable->getPositionAgent(), drawable->getRadius());
switch (result)
{
case 0:
LLSelectMgr::getInstance()->unhighlightObjectOnly(vobjp);
break;
case 1:
// check vertices
if (!LLViewerCamera::getInstance()->areVertsVisible(vobjp, LLSelectMgr::sRectSelectInclusive))
{
LLSelectMgr::getInstance()->unhighlightObjectOnly(vobjp);
}
break;
default:
break;
}
return true;
}
} func;
LLSelectMgr::getInstance()->getHighlightedObjects()->applyToObjects(&func);
}
if (grow_selection)
{
std::vector<LLDrawable*> potentials;
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
{
LLViewerRegion* region = *iter;
for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++)
{
LLSpatialPartition* part = region->getSpatialPartition(i);
if (part)
{
part->cull(*LLViewerCamera::getInstance(), &potentials, TRUE);
}
}
}
for (std::vector<LLDrawable*>::iterator iter = potentials.begin();
iter != potentials.end(); iter++)
{
LLDrawable* drawable = *iter;
LLViewerObject* vobjp = drawable->getVObj();
if (!drawable || !vobjp ||
vobjp->getPCode() != LL_PCODE_VOLUME ||
vobjp->isAttachment() ||
(deselect && !vobjp->isSelected()))
{
continue;
}
if (limit_select_distance && dist_vec_squared(drawable->getWorldPosition(), av_pos) > select_dist_squared)
{
continue;
}
// [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Added: RLVa-1.3.0c
if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canEdit(vobjp)) )
{
continue;
}
// [/RLVa:KB]
S32 result = LLViewerCamera::getInstance()->sphereInFrustum(drawable->getPositionAgent(), drawable->getRadius());
if (result)
{
switch (result)
{
case 1:
// check vertices
if (LLViewerCamera::getInstance()->areVertsVisible(vobjp, LLSelectMgr::sRectSelectInclusive))
{
LLSelectMgr::getInstance()->highlightObjectOnly(vobjp);
}
break;
case 2:
LLSelectMgr::getInstance()->highlightObjectOnly(vobjp);
break;
default:
break;
}
}
}
}
// restore drawing mode
gGL.matrixMode(LLRender::MM_PROJECTION);
gGL.popMatrix();
gGL.matrixMode(LLRender::MM_MODELVIEW);
// restore camera
LLViewerCamera::getInstance()->setFar(old_far_plane);
LLViewerCamera::getInstance()->setNear(old_near_plane);
gViewerWindow->setup3DRender();
}
示例2: handleRectangleSelection
//.........这里部分代码省略.........
struct f : public LLSelectedObjectFunctor
{
virtual bool apply(LLViewerObject* vobjp)
{
LLDrawable* drawable = vobjp->mDrawable;
if (!drawable || vobjp->getPCode() != LL_PCODE_VOLUME || vobjp->isAttachment())
{
return true;
}
S32 result = LLViewerCamera::getInstance()->sphereInFrustum(drawable->getPositionAgent(), drawable->getRadius());
switch (result)
{
case 0:
LLSelectMgr::getInstance()->unhighlightObjectOnly(vobjp);
break;
case 1:
// check vertices
if (!LLViewerCamera::getInstance()->areVertsVisible(vobjp, LLSelectMgr::sRectSelectInclusive))
{
LLSelectMgr::getInstance()->unhighlightObjectOnly(vobjp);
}
break;
default:
break;
}
return true;
}
} func;
LLSelectMgr::getInstance()->getHighlightedObjects()->applyToObjects(&func);
}
if (grow_selection)
{
std::vector<LLDrawable*> potentials;
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
{
LLViewerRegion* region = *iter;
for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++)
{
LLSpatialPartition* part = region->getSpatialPartition(i);
if (part)
{
part->cull(*LLViewerCamera::getInstance(), &potentials, TRUE);
}
}
}
for (std::vector<LLDrawable*>::iterator iter = potentials.begin();
iter != potentials.end(); iter++)
{
LLDrawable* drawable = *iter;
LLViewerObject* vobjp = drawable->getVObj();
if (!drawable || !vobjp ||
vobjp->getPCode() != LL_PCODE_VOLUME ||
vobjp->isAttachment() ||
(deselect && !vobjp->isSelected()))
{
continue;
}
if (limit_select_distance && dist_vec_squared(drawable->getWorldPosition(), av_pos) > select_dist_squared)
{
continue;
}
S32 result = LLViewerCamera::getInstance()->sphereInFrustum(drawable->getPositionAgent(), drawable->getRadius());
if (result)
{
switch (result)
{
case 1:
// check vertices
if (LLViewerCamera::getInstance()->areVertsVisible(vobjp, LLSelectMgr::sRectSelectInclusive))
{
LLSelectMgr::getInstance()->highlightObjectOnly(vobjp);
}
break;
case 2:
LLSelectMgr::getInstance()->highlightObjectOnly(vobjp);
break;
default:
break;
}
}
}
}
// restore drawing mode
glMatrixMode(GL_PROJECTION);
gGL.popMatrix();
glMatrixMode(GL_MODELVIEW);
// restore camera
LLViewerCamera::getInstance()->setFar(old_far_plane);
LLViewerCamera::getInstance()->setNear(old_near_plane);
gViewerWindow->setup3DRender();
}