本文整理汇总了C++中LLMatrix4::initRotTrans方法的典型用法代码示例。如果您正苦于以下问题:C++ LLMatrix4::initRotTrans方法的具体用法?C++ LLMatrix4::initRotTrans怎么用?C++ LLMatrix4::initRotTrans使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLMatrix4
的用法示例。
在下文中一共展示了LLMatrix4::initRotTrans方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: findSelectedManipulator
BOOL QToolAlign::findSelectedManipulator(S32 x, S32 y)
{
mHighlightedAxis = -1;
mHighlightedDirection = 0;
LLMatrix4 transform;
if (LLSelectMgr::getInstance()->getSelection()->getSelectType() == SELECT_TYPE_HUD)
{
LLVector4 translation(mBBox.getCenterAgent());
transform.initRotTrans(mBBox.getRotation(), translation);
LLMatrix4 cfr(OGL_TO_CFR_ROTATION);
transform *= cfr;
LLMatrix4 window_scale;
F32 zoom_level = 2.f * gAgentCamera.mHUDCurZoom;
window_scale.initAll(LLVector3(zoom_level / LLViewerCamera::getInstance()->getAspect(), zoom_level, 0.f),
LLQuaternion::DEFAULT,
LLVector3::zero);
transform *= window_scale;
}
else
{
transform.initAll(LLVector3(1.f, 1.f, 1.f), mBBox.getRotation(), mBBox.getCenterAgent());
LLMatrix4 projection_matrix = LLViewerCamera::getInstance()->getProjection();
LLMatrix4 model_matrix = LLViewerCamera::getInstance()->getModelview();
transform *= model_matrix;
transform *= projection_matrix;
}
LLRect world_view_rect = gViewerWindow->getWorldViewRectScaled();
F32 half_width = (F32)world_view_rect.getWidth() / 2.f;
F32 half_height = (F32)world_view_rect.getHeight() / 2.f;
LLVector2 manip2d;
LLVector2 mousePos((F32)x - half_width, (F32)y - half_height);
LLVector2 delta;
LLVector3 bbox_scale = mBBox.getMaxLocal() - mBBox.getMinLocal();
for (S32 axis = VX; axis <= VZ; axis++)
{
for (F32 direction = -1.0; direction <= 1.0; direction += 2.0)
{
LLVector3 axis_vector = LLVector3(0,0,0);
axis_vector.mV[axis] = direction * bbox_scale.mV[axis] / 2.0;
LLVector4 manipulator_center = LLVector4(axis_vector);
LLVector4 screen_center = manipulator_center * transform;
screen_center /= screen_center.mV[VW];
manip2d.setVec(screen_center.mV[VX] * half_width, screen_center.mV[VY] * half_height);
delta = manip2d - mousePos;
if (delta.magVecSquared() < MANIPULATOR_SELECT_SIZE * MANIPULATOR_SELECT_SIZE)
{
mHighlightedAxis = axis;
mHighlightedDirection = direction;
return TRUE;
}
}
}
return FALSE;
}