本文整理汇总了C++中GraphicsWindow::endSegments方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicsWindow::endSegments方法的具体用法?C++ GraphicsWindow::endSegments怎么用?C++ GraphicsWindow::endSegments使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicsWindow
的用法示例。
在下文中一共展示了GraphicsWindow::endSegments方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawBounds
//.........这里部分代码省略.........
Matrix3 boundsTMInverse;
boundsTMInverse = Inverse(mBoundingTM);
tm = mMeshTM * boundsTMInverse;
for (int i = 0; i < mPreviewMesh->numv; i++)
{
if (mPreviewMesh->v[i].GetFlag(MN_DEAD)) continue;
if (useSel)
{
if (mPreviewMesh->v[i].GetFlag(MN_SEL))
bounds += mPreviewMesh->v[i].p*tm;
}
else
bounds += mPreviewMesh->v[i].p*tm;
}
Point3 p[9];
gw->setColor(ColorType::LINE_COLOR, mBoundsColor);
gw->startMarkers();
p[0] = bounds[0];
p[1] = bounds[1];
p[2] = bounds[2];
p[3] = bounds[3];
bool hit = DrawBoxFace(gw, p, hitTest, hitPoint);
if (hit && hitTest)
return true;
p[0] = bounds[4];
p[1] = bounds[5];
p[2] = bounds[6];
p[3] = bounds[7];
hit = DrawBoxFace(gw, p, hitTest, hitPoint);
if (hit && hitTest)
return true;
p[0] = (bounds[0] + bounds[4])*0.5f;
p[1] = (bounds[1] + bounds[5])*0.5f;
p[2] = (bounds[2] + bounds[6])*0.5f;
p[3] = (bounds[3] + bounds[7])*0.5f;
hit = DrawBoxFace(gw, p, hitTest, hitPoint);
if (hit && hitTest)
return true;
gw->endMarkers();
Point3 edgeColor(mBoundsColor);
edgeColor *= 0.8f;
gw->setColor(ColorType::LINE_COLOR, edgeColor);
gw->startSegments();
p[0] = bounds[0];
p[1] = bounds[1];
p[2] = bounds[3];
p[3] = bounds[2];
p[4] = bounds[0];
for (int i = 0; i < 4; i++)
gw->segment(&p[i], 1);
p[0] = bounds[4];
p[1] = bounds[5];
p[2] = bounds[7];
p[3] = bounds[6];
p[4] = bounds[4];
for (int i = 0; i < 4; i++)
gw->segment(&p[i], 1);
p[0] = bounds[0];
p[1] = bounds[4];
gw->segment(&p[0], 1);
p[0] = bounds[1];
p[1] = bounds[5];
gw->segment(&p[0], 1);
p[0] = bounds[2];
p[1] = bounds[6];
gw->segment(&p[0], 1);
p[0] = bounds[3];
p[1] = bounds[7];
gw->segment(&p[0], 1);
gw->endSegments();
return false;
}