本文整理汇总了C++中LLVector3::clearVec方法的典型用法代码示例。如果您正苦于以下问题:C++ LLVector3::clearVec方法的具体用法?C++ LLVector3::clearVec怎么用?C++ LLVector3::clearVec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLVector3
的用法示例。
在下文中一共展示了LLVector3::clearVec方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: transformCamera
LLCamera LLSpatialBridge::transformCamera(LLCamera& camera)
{
LLCamera ret = camera;
LLXformMatrix* mat = mDrawable->getXform();
LLVector3 center = LLVector3(0,0,0) * mat->getWorldMatrix();
LLQuaternion rotation = LLQuaternion(mat->getWorldMatrix());
LLVector3 delta = ret.getOrigin() - center;
LLQuaternion rot = ~mat->getRotation();
delta *= rot;
LLVector3 lookAt = ret.getAtAxis();
LLVector3 up_axis = ret.getUpAxis();
LLVector3 left_axis = ret.getLeftAxis();
lookAt *= rot;
up_axis *= rot;
left_axis *= rot;
if (!delta.isFinite())
{
delta.clearVec();
}
ret.setOrigin(delta);
ret.setAxes(lookAt, left_axis, up_axis);
return ret;
}
示例2: getManipNormal
void LLManip::getManipNormal(LLViewerObject* object, EManipPart manip, LLVector3 &normal)
{
LLVector3 grid_origin;
LLVector3 grid_scale;
LLQuaternion grid_rotation;
LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rotation, grid_scale);
if (manip >= LL_X_ARROW && manip <= LL_Z_ARROW)
{
LLVector3 arrow_axis;
getManipAxis(object, manip, arrow_axis);
LLVector3 cross = arrow_axis % LLViewerCamera::getInstance()->getAtAxis();
normal = cross % arrow_axis;
normal.normVec();
}
else if (manip >= LL_YZ_PLANE && manip <= LL_XY_PLANE)
{
switch (manip)
{
case LL_YZ_PLANE:
normal = LLVector3::x_axis;
break;
case LL_XZ_PLANE:
normal = LLVector3::y_axis;
break;
case LL_XY_PLANE:
normal = LLVector3::z_axis;
break;
default:
break;
}
normal.rotVec(grid_rotation);
}
else
{
normal.clearVec();
}
}