本文整理汇总了C++中LLVector4a::setMin方法的典型用法代码示例。如果您正苦于以下问题:C++ LLVector4a::setMin方法的具体用法?C++ LLVector4a::setMin怎么用?C++ LLVector4a::setMin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLVector4a
的用法示例。
在下文中一共展示了LLVector4a::setMin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateSpatialExtents
void LLSpatialBridge::updateSpatialExtents()
{
LLSpatialGroup* root = (LLSpatialGroup*) mOctree->getListener(0);
{
LLFastTimer ftm(FTM_CULL_REBOUND);
root->rebound();
}
const LLVector4a* root_bounds = root->getBounds();
LLVector4a offset;
LLVector4a size = root_bounds[1];
const LLMatrix4a& mat = mDrawable->getXform()->getWorldMatrix();
LLVector4a t;
t.splat(0.f);
LLVector4a center;
mat.affineTransform(t, center);
mat.rotate(root_bounds[0], offset);
center.add(offset);
LLVector4a v[4];
//get 4 corners of bounding box
mat.rotate(size,v[0]);
LLVector4a scale;
scale.set(-1.f, -1.f, 1.f);
scale.mul(size);
mat.rotate(scale, v[1]);
scale.set(1.f, -1.f, -1.f);
scale.mul(size);
mat.rotate(scale, v[2]);
scale.set(-1.f, 1.f, -1.f);
scale.mul(size);
mat.rotate(scale, v[3]);
LLVector4a newMin;
LLVector4a newMax;
newMin = newMax = center;
for (U32 i = 0; i < 4; i++)
{
LLVector4a delta;
delta.setAbs(v[i]);
LLVector4a min;
min.setSub(center, delta);
LLVector4a max;
max.setAdd(center, delta);
newMin.setMin(newMin, min);
newMax.setMax(newMax, max);
}
setSpatialExtents(newMin, newMax);
LLVector4a diagonal;
diagonal.setSub(newMax, newMin);
mRadius = diagonal.getLength3().getF32() * 0.5f;
LLVector4a& pos = getGroupPosition();
pos.setAdd(newMin,newMax);
pos.mul(0.5f);
updateBinRadius();
}
示例2: updateShape
//.........这里部分代码省略.........
{
vect_face.push_back(vo->volumePositionToAgent(vert[i]));
}
}
vert_it = vect_face.begin();
vert_end = vect_face.end();
LLMatrix4a mat;
if (!is_hud)
{
mat.setMul(glh_get_current_projection(),glh_get_current_modelview());
}
else {
LLMatrix4a proj, modelview;
if (get_hud_matrices(proj, modelview))
{
//mat = proj * modelview;
mat.setMul(proj,modelview);
}
}
LLVector4a min;
min.splat(1.f);
LLVector4a max;
max.splat(-1.f);
for(; vert_it != vert_end; ++vert_it)
{
// project silhouette vertices into screen space
LLVector4a screen_vert;
screen_vert.load3(vert_it->mV,1.f);
mat.perspectiveTransform(screen_vert,screen_vert);
// add to screenspace bounding box
min.setMin(screen_vert,min);
max.setMax(screen_vert,max);
}
// convert screenspace bbox to pixels (in screen coords)
LLRect window_rect = gViewerWindow->getWorldViewRectScaled();
LLCoordGL screen_min;
screen_min.mX = ll_round((F32)window_rect.mLeft + (F32)window_rect.getWidth() * (min.getF32ptr()[VX] + 1.f) * 0.5f);
screen_min.mY = ll_round((F32)window_rect.mBottom + (F32)window_rect.getHeight() * (min.getF32ptr()[VY] + 1.f) * 0.5f);
LLCoordGL screen_max;
screen_max.mX = ll_round((F32)window_rect.mLeft + (F32)window_rect.getWidth() * (max.getF32ptr()[VX] + 1.f) * 0.5f);
screen_max.mY = ll_round((F32)window_rect.mBottom + (F32)window_rect.getHeight() * (max.getF32ptr()[VY] + 1.f) * 0.5f);
// grow panel so that screenspace bounding box fits inside "media_region" element of panel
LLRect media_panel_rect;
// Get the height of the controls (less the volume slider)
S32 controls_height = mMediaControlsStack->getRect().getHeight() - mVolumeSliderCtrl->getRect().getHeight();
getParent()->screenRectToLocal(LLRect(screen_min.mX, screen_max.mY, screen_max.mX, screen_min.mY), &media_panel_rect);
media_panel_rect.mTop += controls_height;
// keep all parts of panel on-screen
// Area of the top of the world view to avoid putting the controls
window_rect.mTop -= mTopWorldViewAvoidZone;
// Don't include "spacing" bookends on left & right of the media controls
window_rect.mLeft -= mLeftBookend->getRect().getWidth();
window_rect.mRight += mRightBookend->getRect().getWidth();
// Don't include the volume slider
window_rect.mBottom -= mVolumeSliderCtrl->getRect().getHeight();
media_panel_rect.intersectWith(window_rect);
// clamp to minimum size, keeping rect inside window
S32 centerX = media_panel_rect.getCenterX();